Re: Problem doing insert on a datetime field

2005-04-04 Thread Robert A. Rawlinson
Robert A. Rawlinson wrote: I am having a problem doing an insert on a datetime field. Is there something I have to use to convert it to that form? I have it set up in a string as '2000/09/17 00:00:00' but that does not seem to work. Thanks for any help you can offer. Bob Rawlinson

Problem doing insert on a datetime field

2005-04-04 Thread Robert A. Rawlinson
I am having a problem doing an insert on a datetime field. Is there something I have to use to convert it to that form? I have it set up in a string as '2000/09/17 00:00:00' but that does not seem to work. Thanks for any help you can offer. Bob Rawlinson -- MySQL General Mailing Lis

Re: Dummy problem with UPDATE for DATETIME field

2003-10-06 Thread Franck Babin
ype_no = 1 WHERE > >> >DATE_FORMAT(activity_date,'%Y-%m-%d %H:%i:%s') = '2003-06-10 > >> >11:15:00' AND type_no = 1; > >> > > >> >I want to update only rows where equals > >>'2003-06-10 11:15:00' > >>

Re: Dummy problem with UPDATE for DATETIME field

2003-10-06 Thread Paul DuBois
_FORMAT(activity_date,'%Y-%m-%d %H:%i:%s') = '2003-06-10 >11:15:00' AND type_no = 1; > >I want to update only rows where equals '2003-06-10 11:15:00' >Is this formulation correct? > > is really a DATETIME field. >Thanks. In that case

Re: Dummy problem with UPDATE for DATETIME field

2003-10-06 Thread Franck Babin
; AND type_no = 1; > > > >I want to update only rows where equals '2003-06-10 11:15:00' > >Is this formulation correct? > > > > is really a DATETIME field. > >Thanks. > > In that case, you don't need DATE_FORMAT() at all. Just compare activ

Re: Dummy problem with UPDATE for DATETIME field

2003-10-06 Thread Paul DuBois
; I want to update only rows where equals '2003-06-10 11:15:00' Is this formulation correct? is really a DATETIME field. Thanks. In that case, you don't need DATE_FORMAT() at all. Just compare activity_date to the datetime value directly. You still haven't indicated what you

Re: Dummy problem with UPDATE for DATETIME field

2003-10-06 Thread Franck Babin
quals '2003-06-10 11:15:00' Is this formulation correct? is really a DATETIME field. Thanks. --- Paul DuBois <[EMAIL PROTECTED]> wrote: > At 11:28 -0400 10/6/03, Franck Babin wrote: > >I have this simple sql statement: > > > >UDPATE activity > >SET activity_d

Re: Dummy problem with UPDATE for DATETIME field

2003-10-06 Thread Paul DuBois
e query. It seems that the portion is not valid. is a DATETIME field. Any idea? What do you mean by "is not valid"? The comparison doesn't work? The correct value doesn't get stored into the row? In any case, if activity_date really is a DATETIME column, you must store valu

RE: Dummy problem with UPDATE for DATETIME field

2003-10-06 Thread Hsiu-Hui Tseng
your date format is not correct. It should be activity_date = '2003-9-10 10:00:00'. -Original Message- From: Franck Babin [mailto:[EMAIL PROTECTED] Sent: Monday, October 06, 2003 8:28 AM To: [EMAIL PROTECTED] Subject: Dummy problem with UPDATE for DATETIME field I have this

Dummy problem with UPDATE for DATETIME field

2003-10-06 Thread Franck Babin
I have this simple sql statement: UDPATE activity SET activity_date = '9.10.2003 10:00:00', type_no = 1 WHERE DATE_FORMAT(activity_date,'%d.%m.%Y %H:%i') = '09.10.2003 10:00' AND type_no = 1; I'm not able to execute the query. It seems that the portion is n

RE: Adding up DATETIME field

2003-08-21 Thread M. Bader
Hi again, > From: Diana Soares [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 21, 2003 4:05 PM > | NOW() + sec_to_time(6000) | That i allready tried, and it's leading to wrong results, as same as > From: Cybot [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 21, 2003 3:42 PM > UPDATE `user

Re: Adding up DATETIME field

2003-08-21 Thread Diana Soares
. > > Can you tell me, how to correctly add an amount of seconds (after that > the session expires) to a datetime field? > > when i do the insert for a new login, or an update, the expire field > will alway end up containing zeros > > below are my statements and structure,

Re: Adding up DATETIME field

2003-08-21 Thread Cybot
M. Bader wrote: Hi, i'm struggling with updating session expire times in my login table. Can you tell me, how to correctly add an amount of seconds (after that the session expires) to a datetime field? when i do the insert for a new login, or an update, the expire field will alway e

Adding up DATETIME field

2003-08-21 Thread M. Bader
Hi, i'm struggling with updating session expire times in my login table. Can you tell me, how to correctly add an amount of seconds (after that the session expires) to a datetime field? when i do the insert for a new login, or an update, the expire field will alway end up containing

RE: datetime field question

2003-01-30 Thread Sherzod Ruzmetov
:is there a way to use the date part of a datetime field that :still uses the :index on the datetime field? i've tried a few different things :and it keeps :saying in the explain it says that its a possible_key, but :NULL for the key I'm not sure if this i

datetime field question

2003-01-29 Thread Ray
is there a way to use the date part of a datetime field that still uses the index on the datetime field? i've tried a few different things and it keeps saying in the explain it says that its a possible_key, but NULL for the key -- mysql, sql, query, sql, sql

Re: comparision in the datetime field

2003-01-04 Thread Octavian Rasnita
al Message - From: "aman raheja" <[EMAIL PROTECTED]> To: "mysql" <[EMAIL PROTECTED]> Sent: Friday, January 03, 2003 7:25 PM Subject: comparision in the datetime field Hi All I have a datetime field in one of my tables in the MySQL database. Can I do something li

re: comparision in the datetime field

2003-01-04 Thread Paul DuBois
At 15:07 +0200 1/4/03, Egor Egorov wrote: On Friday 03 January 2003 19:25, aman raheja wrote: I have a datetime field in one of my tables in the MySQL database. Can I do something like return all records between two certain dates, say between Nov 02, 2002 and Nov 07, 2002. SELECT .. WHERE

re: comparision in the datetime field

2003-01-04 Thread Egor Egorov
On Friday 03 January 2003 19:25, aman raheja wrote: > I have a datetime field in one of my tables in the MySQL database. > Can I do something like return all records between two certain dates, say > between Nov 02, 2002 and Nov 07, 2002. SELECT .. WHERE mydatefield BETWEEN '2002-

comparision in the datetime field

2003-01-03 Thread aman raheja
Hi All I have a datetime field in one of my tables in the MySQL database. Can I do something like return all records between two certain dates, say between Nov 02, 2002 and Nov 07, 2002. Thanks Aman - Before posting, please check

Re: datetime field as key

2002-12-23 Thread Michael She
Hi, you can use a DateTime field, but it is possible to get duplicate datetimes if you insert multiple queries fast enough. At 04:17 PM 12/23/2002 -0200, João Borsoi Soares wrote: I would like to use a datetime field as a key. I'm wondering if I will have any problems with key violati

datetime field as key

2002-12-23 Thread João Borsoi Soares
I would like to use a datetime field as a key. I'm wondering if I will have any problems with key violation. I found in the document something saying that timestamp fields are precise, like unix time, but I don't want it to be changing on update. Does anyone has some experience with i

Re: fetching specific date from datetime field

2002-10-09 Thread nellA hciR
select * from table where substring(timestampField,1,8) = 'MMDD' from Perl, execute this statement and then process each returned row - hcir > My mysql database is set up having a field cdate > -> cdate datetime > > has the format > > -00-00 00:00:00 > > If I want to fetch rows for sa

fetching specific date from datetime field

2002-10-09 Thread aman mysql
Hi All My mysql database is set up having a field cdate -> cdate datetime has the format -00-00 00:00:00 If I want to fetch rows for say the date 2000-12-19, I do it using perl (it's a tediuos code) Is there a way to do it using sql queries Also how can I get betwee two specific date that

Re: Date Field + Time Field = Datetime Field?

2002-01-11 Thread DL Neil
From: "Anvar Hussain K.M." <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: 11 January 2002 04:05 Subject: Re: Date Field + Time Field = Datetime Field? > Hi Alex, > > I don't think your problem will solved by making the time columns to full > datetime c

Re: Date Field + Time Field = Datetime Field?

2002-01-10 Thread Anvar Hussain K.M.
Hi Alex, I don't think your problem will solved by making the time columns to full datetime columns as there is no functions to subtract two datetime values directly. But you can can keep the time columns and go on like this: convert the time into seconds using time_to_sec function. subtract f

Date Field + Time Field = Datetime Field?

2002-01-10 Thread Alex Kirk
I've been working with a timesheet database, where all the employees of my small business enter in the hours they work on projects. I've been storing, for each record, a date of work, a start time, and a finish time. When I attempted to write a Perl script to display invoices, though, I ran i

Re: Creating Table with a Default Datetime field

2001-06-28 Thread Paul DuBois
At 11:57 AM +0200 6/28/01, Kaneda K wrote: >At 10:38 27/06/2001 -0700, you wrote: >>Sorry, for quoting the manual but this might be just another example where >>it could have the answer right away: >>Hannes >> >>http://www.mysql.com/doc/D/A/DATETIME.html > >On my own mysql version : > Date TIMEST

Re: Creating Table with a Default Datetime field

2001-06-28 Thread Gerald Clark
No. Since the string "now()" is not a valid date it is equivalent to 0, so MySQL inserts the current date and time. Kaneda K wrote: > At 10:38 27/06/2001 -0700, you wrote: > >> Sorry, for quoting the manual but this might be just another example >> where >> it could have the answer right away

Re: Creating Table with a Default Datetime field

2001-06-28 Thread Kaneda K
At 10:38 27/06/2001 -0700, you wrote: >Sorry, for quoting the manual but this might be just another example where >it could have the answer right away: >Hannes > >http://www.mysql.com/doc/D/A/DATETIME.html On my own mysql version : Date TIMESTAMP default "now()", Works correctly, the date is YY

Re: Creating Table with a Default Datetime field

2001-06-27 Thread Rich Duzenbury
Only the first timestamp is updated by MYSQL. Create two timestamp fields. MySQL will maintain the first one. Set timestamp2 to null when the record is created. Regards, Rich At 10:54 AM 6/27/01 -0500, Pete Harlan wrote: >TIMESTAMP is not the solution to his problem; he wants the date to >

RE: Creating Table with a Default Datetime field

2001-06-27 Thread Sherzod Ruzmetov
ilto:[EMAIL PROTECTED]] > Sent: Wednesday, June 27, 2001 2:10 PM > To: Ravi Raman > Cc: Pete Harlan; Richard Bates; [EMAIL PROTECTED] > Subject: RE: Creating Table with a Default Datetime field > > > > Wait, I didn't get the following: > > > &g

RE: Creating Table with a Default Datetime field

2001-06-27 Thread Ravi Raman
erzod Ruzmetov [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 27, 2001 2:10 PM To: Ravi Raman Cc: Pete Harlan; Richard Bates; [EMAIL PROTECTED] Subject: RE: Creating Table with a Default Datetime field Wait, I didn't get the following: > an alternate solution is to have a table like th

RE: Creating Table with a Default Datetime field

2001-06-27 Thread Sherzod Ruzmetov
: Pete Harlan > Cc: Ravi Raman; Richard Bates; [EMAIL PROTECTED] > Subject: Re: Creating Table with a Default Datetime field > > > > > I, c. Then you just have to INSERT INTO it NOW() manually, that works > > > On Wed, 27 Jun 2001, Pete Harlan wrote: > >

RE: Creating Table with a Default Datetime field

2001-06-27 Thread Ravi Raman
- From: Sherzod Ruzmetov [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 27, 2001 1:40 PM To: Pete Harlan Cc: Ravi Raman; Richard Bates; [EMAIL PROTECTED] Subject: Re: Creating Table with a Default Datetime field I, c. Then you just have to INSERT INTO it NOW() manually, that works On Wed, 27

Re: Creating Table with a Default Datetime field

2001-06-27 Thread Gerald Clark
gt;> type? >> you can then format the date accordingly with...uh...DATE_FORMAT() in your >> select statements... >> >> hth. >> -ravi >> >> >> -Original Message- >> From: Richard Bates [mailto:[EMAIL PROTECTED]] >> Sent: Tuesday, J

Re: Creating Table with a Default Datetime field

2001-06-27 Thread Sherzod Ruzmetov
FORMAT() in your > > select statements... > > > > hth. > > -ravi > > > > > > -Original Message- > > From: Richard Bates [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, June 26, 2001 3:00 PM > > To: [EMAIL PROTECTED] > > Subject: Creating Tab

Re: Creating Table with a Default Datetime field

2001-06-27 Thread Hannes Niedner
ck out the TIMESTAMP column type...maybe TIMESTAMP(14) as the column >> type? >> you can then format the date accordingly with...uh...DATE_FORMAT() in your >> select statements... >> >> hth. >> -ravi >> >> >> -Original Message- >> F

Re: Creating Table with a Default Datetime field

2001-06-27 Thread Pete Harlan
PM > To: [EMAIL PROTECTED] > Subject: Creating Table with a Default Datetime field > > > How do I get a default date time in the create table clause... > > I have tried > > Create table( > CreationDateDATETIMEDEFAULT NOW(), > Infovarc

RE: Creating Table with a Default Datetime field

2001-06-26 Thread Ravi Raman
:00 PM To: [EMAIL PROTECTED] Subject: Creating Table with a Default Datetime field How do I get a default date time in the create table clause... I have tried Create table( CreationDateDATETIMEDEFAULT NOW(), Infovarchar(100) ); Create table( CreationDate

Creating Table with a Default Datetime field

2001-06-26 Thread Richard Bates
How do I get a default date time in the create table clause... I have tried Create table( CreationDateDATETIMEDEFAULT NOW(), Infovarchar(100) ); Create table( CreationDateDATETIMEDEFAULT "NOW()", Infovarchar(100) ); Create table( Creat

Re: deleting old records VS. index on datetime field (question about optimization)

2001-02-18 Thread Rolf Hopkins
- Original Message - From: "Jan Namedyński" <[EMAIL PROTECTED]> To: "Rolf Hopkins" <[EMAIL PROTECTED]> Cc: "mysql" <[EMAIL PROTECTED]> Sent: Monday, February 19, 2001 10:02 Subject: Re: deleting old records VS. index on datetime field (que

Re: deleting old records VS. index on datetime field (question about optimization)

2001-02-18 Thread Jan Namedyński
Rolf Hopkins wrote: > > That all depends. > > Do you need to keep the data for historical purposes? I don't have to but I want ;-). it means that if speed difference would be small I will. Are your queries > running particularly slowly? Have you read the manual about how you can > optimize

Re: deleting old records VS. index on datetime field (question about optimization)

2001-02-18 Thread Rolf Hopkins
wrong. - Original Message - From: "Jan Namedyński" <[EMAIL PROTECTED]> To: "mysql" <[EMAIL PROTECTED]> Sent: Friday, February 16, 2001 21:09 Subject: deleting old records VS. index on datetime field (question about optimization) > Hi, > I have a table &g

deleting old records VS. index on datetime field (question about optimization)

2001-02-16 Thread Jan Namedyński
Hi, I have a table DAY : DATETIME CAT_ID : INT DATA : TEXT ID : INT and I have to extract all records not older than 2 weeks with given CAT_ID (sorted by DAY). query for that is very simple, but what if this table has 1 000 000 records? Do you think that deleting records older than eg

Re: datetime field

2001-01-20 Thread Dan Nelson
In the last episode (Jan 21), Muhammad Farhan Ghazi said: > How much space is taken by the datetime field? http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#Storage_requirements > Is there any way that we can only store date or time in it? http://www.mys

datetime field

2001-01-20 Thread Muhammad Farhan Ghazi
How much space is taken by the datetime field? Is there any way that we can only store date or time in it? How we can seperate date and time from this field? _ Get Your Private, Free E-mail from MSN Hotmail at http

datetime field

2001-01-20 Thread Muhammad Farhan Ghazi
How much space is taken by the datetime field? Is there any way that we can only store date or time in it? How we can seperate date and time from this field? Regaards, Ghazi, Muhammad Farhan _ Get Your Private, Free E