Re: DATETIME vs CHAR for "timestamp"

2017-04-24 Thread SSC_perl
d on both DATE and DATETIME, depending on whether the time is needed or not, which means I’ll have to change some of my code, but that will only strengthen the script in the long run. Thanks again, Frank https://www.surfshopcart.com -- MySQL General Mailing List For list archives: http://lists.

Re: DATETIME vs CHAR for "timestamp"

2017-04-14 Thread shawn l.green
On 4/14/2017 3:11 PM, SSC_perl wrote: I have creation date/time fields in my script that are formatted as |MM|DD|hh|mm|ss. Short of changing the script, should I set the field type in MySQL to DATETIME, or would it be better in terms of speed and efficiency to set it as char(19

DATETIME vs CHAR for "timestamp"

2017-04-14 Thread SSC_perl
I have creation date/time fields in my script that are formatted as |MM|DD|hh|mm|ss. Short of changing the script, should I set the field type in MySQL to DATETIME, or would it be better in terms of speed and efficiency to set it as char(19)? Or would it not make a difference

RE: Bug in BETWEEN same DATETIME

2013-05-29 Thread Rick James
t; Sent: Friday, May 24, 2013 11:08 AM > To: mysql@lists.mysql.com > Subject: Re: Bug in BETWEEN same DATETIME > > >>>> 2013/05/24 09:49 -0400, shawn green >>>> > Or we could coerce datetime values back to their date values when both > are being used. The

Re: Bug in BETWEEN same DATETIME

2013-05-24 Thread hsv
>>>> 2013/05/24 09:49 -0400, shawn green >>>> Or we could coerce datetime values back to their date values when both are being used. The trick now becomes choosing between rounding the datetime value (times past noon round to the next date) or do we use the floor(

Re: Bug in BETWEEN same DATETIME

2013-05-24 Thread shawn green
(until 5.6), that is equivalent to a 1-second DATETIME. I also assume midnight belongs to the day that it is the _start_ of. There is also a strong desire to make a database server try to do exactly what the user tells it to do. That is difficult, because of definitions and representation

RE: Bug in BETWEEN same DATETIME

2013-05-24 Thread Rick James
For years (even decades), I have stayed out of trouble by assuming a 'date' represents the instant in time corresponding to midnight at the start of that day. In MySQL (until 5.6), that is equivalent to a 1-second DATETIME. I also assume midnight belongs to the day that it is the

Re: Bug in BETWEEN same DATETIME

2013-05-24 Thread shawn green
transformation for you. Hint, hint, Shawn.) Or we could coerce datetime values back to their date values when both are being used. The trick now becomes choosing between rounding the datetime value (times past noon round to the next date) or do we use the floor() function all the time. This

Re: Bug in BETWEEN same DATETIME

2013-05-23 Thread Andrew Moore
Personally I don't share your view that it's a bug. Omitting the time results in midnight by default so this screws between because there's no time between 00:00:00 and 00:00:00. Are you having operational issues here or are you simply fishing for bugs? WHERE `transaction_date`

RE: Bug in BETWEEN same DATETIME

2013-05-23 Thread Peterson, Timothy R
m] Sent: Thursday, May 23, 2013 3:56 PM To: mysql@lists.mysql.com Subject: Bug in BETWEEN same DATETIME I just noticed what I consider to be a bug; and related, has this been fixed in later versions of MySQL? We are using: mysql Ver 14.12 Distrib 5.0.92, for portbld-freebsd8.1 (amd64) using 5.

Re: Bug in BETWEEN same DATETIME

2013-05-23 Thread Michael Dykman
> That works on my test case > > You could also change the where clause to be >= date and < date+1 > > > > -Original Message- > From: Daevid Vincent [mailto:dae...@daevid.com] > Sent: Thursday, May 23, 2013 3:56 PM > To: mysql@lists.mysql.com > Subject

Re: Bug in BETWEEN same DATETIME

2013-05-23 Thread shawn green
(i.e. you want a single day) it appears that the operator isn't smart enough to consider the full day in the cases where the column is a DATETIME http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#operator_be tween WHERE `transaction_date` BETWEEN '2013-04-16' AND

RE: Bug in BETWEEN same DATETIME

2013-05-23 Thread Rick James
iginal Message- > From: shawn green [mailto:shawn.l.gr...@oracle.com] > Sent: Thursday, May 23, 2013 3:50 PM > To: mysql@lists.mysql.com > Subject: Re: Bug in BETWEEN same DATETIME > > > > On 5/23/2013 4:55 PM, Daevid Vincent wrote: > > I just noticed what I

RE: Bug in BETWEEN same DATETIME

2013-05-23 Thread Rick James
I use this; it keeps me out of trouble whether I am using * MySQL's DATE vs DATETIME vs TIMESTAMP * Sybase dates (to minute or to millisecond, hence :59:59 does not work) * leap year WHERE dt >= ? AND dt < ? + INTERVAL ? DAY I fill in the first two "?" with t

Re: Bug in BETWEEN same DATETIME

2013-05-23 Thread Andrew Moore
there's no > time between 00:00:00 and 00:00:00. > > Are you having operational issues here or are you simply fishing for bugs? > > WHERE `transaction_date` = DATE(datetime) > or > WHERE `transaction_date` = (new column stored as date) > > > > > > On Th

Re: how to changing default '-' character in Datetime in MySQL?

2012-02-06 Thread Hal�sz S�ndor
2012/02/05 21:56 -0800, Peter Brawley On 2/5/2012 9:21 PM, Michael Dykman wrote: >You are right. It seems to have fallen into disuse since I used it last. AFAIK it has never been used. One use occurred to me, and I was thinking of this, to set "date_format" in the configuratio

Re: how to changing default '-' character in Datetime in MySQL?

2012-02-05 Thread Peter Brawley
unused. *datetime_format This variable is unused. - Original Message - From: Michael Dykman To: mysql mailing list Cc: Sent: Sunday, February 5, 2012 9:24 PM Subject: Re: how to changing default '-' character in Datetime in MySQL? To clarify, what we are discussing is

Re: how to changing default '-' character in Datetime in MySQL?

2012-02-05 Thread Michael Dykman
This variable is unused. > > > - Original Message - > From: Michael Dykman > To: mysql mailing list > Cc: > Sent: Sunday, February 5, 2012 9:24 PM > Subject: Re: how to changing default '-' character in Datetime in MySQL? > > To clarify, what we are discus

Re: how to changing default '-' character in Datetime in MySQL?

2012-02-05 Thread Rajeev Prasad
'-' character in Datetime in MySQL? To clarify, what we are discussing is the "date format". It has nothing to do with how it is stored.  It is stored as binary data whatever your format is.  What the date format does effect is how that data is formatted upon conversion to a

Re: how to changing default '-' character in Datetime in MySQL?

2012-02-05 Thread Michael Dykman
refer. Refer to the documentation page below for details on manipulating system variables either globally or on a per-session basis. http://dev.mysql.com/doc/refman/4.1/en/server-system-variables.html - michael dykman 2012/2/5 Halász Sándor : >>>>> 2012/02/04 19:13 -0800, Rajeev Pras

Re: how to changing default '-' character in Datetime in MySQL?

2012-02-05 Thread Hal�sz S�ndor
>>>> 2012/02/04 19:13 -0800, Rajeev Prasad >>>> MySQL datetime field type keeps data as: -MM-DD HH:mm:SS is there a way to store this data as: /MM/DD HH:mm:SS or going much further (optionally) can we store as: MM/DD/ HH:mm:SS ? if not then whats the best w

Re: Quantity of time from difference of two Datetime values?

2011-10-01 Thread Jan Steinman
Thanks, Hank! I figured it was something like that, but couldn't see any clear documentation on the Oracle reference page on date/time functions. On Sep 30, 2011, at 8:22 PM, Hank wrote: > n Fri, Sep 30, 2011 at 11:08 PM, Jan Steinman wrote: >> Okay, I've reviewed the online man page for date

Re: Quantity of time from difference of two Datetime values?

2011-10-01 Thread Hal�sz S�ndor
2011/09/30 20:08 -0700, Jan Steinman Okay, I've reviewed the online man page for date and time functions, and I've played with several likely candidates, and I am still having trouble subtracting two arbitrary Datetimes to get something that is useful. A simple subtraction yields the l

Re: Quantity of time from difference of two Datetime values?

2011-09-30 Thread Hank
n Fri, Sep 30, 2011 at 11:08 PM, Jan Steinman wrote: > Okay, I've reviewed the online man page for date and time functions, and I've > played with several likely candidates, and I am still having trouble > subtracting two arbitrary Datetimes to get something that is useful. A simple > subtracti

Quantity of time from difference of two Datetime values?

2011-09-30 Thread Jan Steinman
Okay, I've reviewed the online man page for date and time functions, and I've played with several likely candidates, and I am still having trouble subtracting two arbitrary Datetimes to get something that is useful. A simple subtraction yields the least useful thing possible: a modulo-100 differ

Re: Extraneous warning 1292 (Incorrect datetime value)

2011-08-18 Thread Marius Feraru
em, the IF( DATE(d) = "some-date", TIME(d), d ) was. That is step #3: -- 1) create test table containing a single DATETIME column CREATE TABLE dt (d DATETIME); -- 2) insert two test records INSERT INTO dt VALUES ("2011-08-07 10:11:12"),("1234-05-06 07:08:09"); -

Re: Extraneous warning 1292 (Incorrect datetime value)

2011-08-12 Thread Hal�sz S�ndor
>>>> 2011/08/07 18:20 +0300, Marius Feraru >>>> Would someone please shed some light on what's wrong with calls like IF( DATE(d) = "some-date", TIME(d), d ) on DATETIME columns? Thank you. I run some tests on mysql 5.0, 5.1 and 5.5: got the same w

Re: Extraneous warning 1292 (Incorrect datetime value)

2011-08-07 Thread Marius Feraru
On Sun, Aug 7, 2011 at 20:34, Dan Nelson wrote: > I think you need to swap your arguments to DATE_FORMAT Of course, sorry about that stupid example, I was just trying to build up from the original problem and failed. Thanks :) The problem still stands though. Any ideas? -ab -- MySQL General Ma

Re: Extraneous warning 1292 (Incorrect datetime value)

2011-08-07 Thread Dan Nelson
| d | wtf2| > +-+-+ > | 2011-08-07 10:11:12 | NULL| > | 1234-05-06 07:08:09 | 1234-05-06 07:08:09 | > +-+-+ > 2 rows in set, 1 warning (0.01 sec) > > Warning (Code 1292): Incorrect datetime value: '%T' I

Extraneous warning 1292 (Incorrect datetime value)

2011-08-07 Thread Marius Feraru
Hello Would someone please shed some light on what's wrong with calls like IF( DATE(d) = "some-date", TIME(d), d ) on DATETIME columns? Thank you. I run some tests on mysql 5.0, 5.1 and 5.5: got the same wierd results everywhere, so I guess I'm missing something, but what

RE: Compare DATETIME to DATE

2008-12-31 Thread Gary W. Smith
Truncate the time part of the datetime field when doing the compare AND DATE_FORMAT(customer.created_dt, '%Y-%m-%d 00:00:00') BETWEEN '2008-12-30' AND '2008-12-30' Should work. Probably not the most efficient. The other options would be to use take end date +

RE: Compare DATETIME to DATE

2008-12-31 Thread Jerry Schwartz
>-Original Message- >From: Johnny Withers [mailto:joh...@pixelated.net] >Sent: Wednesday, December 31, 2008 1:13 PM >To: MySQL General List >Subject: Compare DATETIME to DATE > >Hi, >I don't quite understand (or even know) what the "proper" way to

Compare DATETIME to DATE

2008-12-31 Thread Johnny Withers
Hi, I don't quite understand (or even know) what the "proper" way to compare a DATETIME column to a given DATE value is. I've used various methods but I'd like to know if there's a better way to compare these values. Right now I have a query with this in the WHERE cl

Res: german datetime format?

2007-10-22 Thread Wagner Bianchi
27 - 8803 - Mensagem original De: Baron Schwartz <[EMAIL PROTECTED]> Para: Ralf Hüsing <[EMAIL PROTECTED]> Cc: mysql@lists.mysql.com Enviadas: Sexta-feira, 19 de Outubro de 2007 22:56:02 Assunto: Re: german datetime format? Ralf Hüsing wrote: > Hi, > > can i change the dateti

Re: german datetime format?

2007-10-19 Thread Baron Schwartz
Ralf Hüsing wrote: Hi, can i change the datetime format on mysql in a german format? At the moment the dates are stored like "2007-10-19 19:06:17" but if i send a query (which comes from user input) the query looks like "WHERE Datum >= '19.10.2007'" and i

german datetime format?

2007-10-19 Thread Ralf Hüsing
Hi, can i change the datetime format on mysql in a german format? At the moment the dates are stored like "2007-10-19 19:06:17" but if i send a query (which comes from user input) the query looks like "WHERE Datum >= '19.10.2007'" and i got not what i wa

RE: MySQL DateTime Source on CentOS 5

2007-09-13 Thread Edward Kay
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: 13 September 2007 15:32 > To: mysql@lists.mysql.com > Subject: MySQL DateTime Source on CentOS 5 > > > I'm running Apache/MySQL/PHP5 on a CentOS 5 server and have > started to

MySQL DateTime Source on CentOS 5

2007-09-13 Thread dpgirago
I'm running Apache/MySQL/PHP5 on a CentOS 5 server and have started to get some strange date and time inconsistencies between OS time and MySQL time ("now()"). 1. MySQL Time: [EMAIL PROTECTED] mysql -bA Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 to s

Re: datetime type conversion problem

2007-05-29 Thread Rob Desbois
compare a DATETIME to two DATE values, convert the DATE values to DATETIME values. If you use a string constant such as '2001-1-1' in a comparison to a DATE, cast the string to a DATE. Doesn't necessarily explain why it doesn't work but does suggest the fix. Thanks all for your i

Re: datetime type conversion problem

2007-05-29 Thread Rob Desbois
o fine for me if I change the two 2007-3-23 to 2007-03-23. Fred -Original Message- From: Rob Desbois [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 29, 2007 5:02 AM To: mysql@lists.mysql.com Subject: datetime type conversion problem I am having issues with type conversion not working as ex

RE: datetime type conversion problem

2007-05-29 Thread Fred Ballard
Everything seems to go fine for me if I change the two 2007-3-23 to 2007-03-23. Fred -Original Message- From: Rob Desbois [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 29, 2007 5:02 AM To: mysql@lists.mysql.com Subject: datetime type conversion problem I am having issues with type

Re: datetime type conversion problem

2007-05-29 Thread Baron Schwartz
-05-24 00:00:00' BETWEEN ('2007-3-23' - INTERVAL 24 HOUR) AND '2007-3-23 23:59:59'; Thus it should return 0 as 24th May is not in the given range. I get the result 1 however... If I perform an explicit conversion using CAST('2007-3-23 23:59:59' AS DATETI

Re: datetime type conversion problem

2007-05-29 Thread Chris
the last string to a timestamp then perform date-time comparison: SELECT '2007-05-24 00:00:00' BETWEEN ('2007-3-23' - INTERVAL 24 HOUR) AND '2007-3-23 23:59:59'; Thus it should return 0 as 24th May is not in the given range. I get the result 1 however... If I per

datetime type conversion problem

2007-05-29 Thread Rob Desbois
TWEEN ('2007-3-23' - INTERVAL 24 HOUR) AND '2007-3-23 23:59:59'; Thus it should return 0 as 24th May is not in the given range. I get the result 1 however... If I perform an explicit conversion using CAST('2007-3-23 23:59:59' AS DATETIME) I get 0 as expected. Can an

Re: Can I create a index on a column of Type datetime?

2007-04-12 Thread Brent Baisley
TED]> Sent: Thursday, April 12, 2007 10:13 AM Subject: Re: Can I create a index on a column of Type datetime? Thank you, what 's the meaning of "using a datetime field unless it's the last field in the index."? the below is the desc result;Should I create an index on (sour

Re: Can I create a index on a column of Type datetime?

2007-04-11 Thread wangxu
No,I am just asking for a solution to speed up my queries. Martijn Tonies wrote: > >> I will very often do query like this: >> >> select * from mytable where create_date >='...' and create_date <='' >> >> can I create a index on the column create_date? >> > > Have you tried it? > > >

Re: Can I create a index on a column of Type datetime?

2007-04-11 Thread wangxu
Thank you, what 's the meaning of "using a datetime field unless it's the last field in the index."? the below is the desc result;Should I create an index on (source_url,create_date)? for these two fields are to

Re: Can I create a index on a column of Type datetime?

2007-04-11 Thread Martijn Tonies
> I will very often do query like this: > > select * from mytable where create_date >='...' and create_date <='' > > can I create a index on the column create_date? Have you tried it? > what is the best practise? Martijn Tonies Database Workbench - tool for InterBase, Firebird, MySQL, Nexu

Can I create a index on a column of Type datetime?

2007-04-11 Thread wangxu
I will very often do query like this: select * from mytable where create_date >='...' and create_date <='' can I create a index on the column create_date? what is the best practise? Thanks, shell. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscrib

Re: Default Value to a DateTime Column

2007-03-13 Thread Steve Edberg
At 9:30 PM -0300 3/13/07, allysonalves wrote: Hi everybody Has some way to set up a function, like now(), as a default value of an dateTime column. Is some thing like this. Create Table Persons ( PersonCode int(10) zerofill not null auto_increment, PersonName varchar(150) not null

Default Value to a DateTime Column

2007-03-13 Thread allysonalves
Hi everybody Has some way to set up a function, like now(), as a default value of an dateTime column. Is some thing like this. Create Table Persons ( PersonCode int(10) zerofill not null auto_increment, PersonName varchar(150) not null, CadastreDate DateTime not null default now(), Primary Key

Re: Date v. DateTime index performance

2007-01-10 Thread Anders Lundgren
ay of the month and < the first day of the next month. That will use an index. - Original Message - From: "Anders Lundgren" <[EMAIL PROTECTED]> To: "Dan Buettner" <[EMAIL PROTECTED]> Cc: "Thomas Bolioli" <[EMAIL PROTECTED]>; Sent:

Re: Date v. DateTime index performance

2007-01-10 Thread Brent Baisley
That will use an index. - Original Message - From: "Anders Lundgren" <[EMAIL PROTECTED]> To: "Dan Buettner" <[EMAIL PROTECTED]> Cc: "Thomas Bolioli" <[EMAIL PROTECTED]>; Sent: Tuesday, January 09, 2007 8:34 PM Subject: Re: Date v. DateTime

Re: Date v. DateTime index performance

2007-01-10 Thread Anders Lundgren
OK, thank you. How is the speed of this index compared with an indexed date column if I do: year_number='x' and month_number='y' and day_number='z'; They should have about the same cardinality, right? Thanks, Anders Chris wrote: Anders Lundgren wrote: > One potential solution might be to

Re: Date v. DateTime index performance

2007-01-09 Thread Chris
Anders Lundgren wrote: > One potential solution might be to use an extra column that tracks > month_number, and populate it with a trigger on insert or update. > Index that field and then use it in your WHERE clause. One > possibility anyway. Resulting question, what if I have three colums

Re: Date v. DateTime index performance

2007-01-09 Thread Anders Lundgren
ed? Thanks, Anders Dan Buettner wrote: Thomas, I do not think in this case that one is better than the other, for the most part, because both require using a value computed from the column. Computing month from a DATE field should be just as fast as computing from a DATETIME column I would

Re: Date v. DateTime index performance

2006-12-04 Thread Dan Buettner
Thomas, I do not think in this case that one is better than the other, for the most part, because both require using a value computed from the column. Computing month from a DATE field should be just as fast as computing from a DATETIME column I would think. Also splitting into DATE and TIME

Date v. DateTime index performance

2006-12-04 Thread Thomas Bolioli
If one has a large number of records per month and normally searches for things by month, yet needs to keep things time coded, does anyone know if it make sense to use datetime or separate date and a time columns? Thanks, Tom -- MySQL General Mailing List For list archives: http

Bug in 4.1.21 with "between" comparing datetime and dates?

2006-09-13 Thread Pete Harlan
I just filed bug #22317 about this. The following script fails to return a row under 4.1.21 (on x86_64, anyway), but works correctly on 4.1.20 (and .18): drop table if exists test1; create table test1 ( datetimeval datetime, dateval1 date

Re: DBD/DBI datetime insert

2006-09-03 Thread Hal Wigoda
that looks very good. On Sep 3, 2006, at 7:26 PM, Paul DuBois wrote: At 7:23 PM -0500 9/3/06, Hal Wigoda wrote: anyone have the code that will insert the current time into a datetime field in a table while using perl DBI/DBD::mysql? Something like this: $dbh->do("INSER

Re: DBD/DBI datetime insert

2006-09-03 Thread Paul DuBois
At 7:23 PM -0500 9/3/06, Hal Wigoda wrote: anyone have the code that will insert the current time into a datetime field in a table while using perl DBI/DBD::mysql? Something like this: $dbh->do("INSERT INTO t (col_name) VALUES(NOW())"); -- Paul DuBois, MySQL Documentation

DBD/DBI datetime insert

2006-09-03 Thread Hal Wigoda
anyone have the code that will insert the current time into a datetime field in a table while using perl DBI/DBD::mysql? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: datetime issue on MySQL 4.x

2006-07-12 Thread Gerald L. Clark
NOT NULL default '', `sms_id` varchar(250) NOT NULL default '', `dlr_smsc` text NOT NULL, `dlr` tinyint(4) NOT NULL default '0', `date_time` datetime NOT NULL default '-00-00 00:00:00' ) TYPE=MyISAM I have a case here, on July 7 I imported some

Re: datetime issue on MySQL 4.x (SOLVED)

2006-07-11 Thread Willy
Hello, I have solved this problem, thanks. Regards Willy - Original Message - From: Willy To: mysql@lists.mysql.com Sent: Wednesday, July 12, 2006 8:55 AM Subject: datetime issue on MySQL 4.x Hello, I have a MyISAM table: CREATE TABLE `dlr` ( `msisdn` varchar

datetime issue on MySQL 4.x

2006-07-11 Thread Willy
#x27;', `sms_id` varchar(250) NOT NULL default '', `dlr_smsc` text NOT NULL, `dlr` tinyint(4) NOT NULL default '0', `date_time` datetime NOT NULL default '-00-00 00:00:00' ) TYPE=MyISAM I have a case here, on July 7 I imported some data into the

Re: DateTime limits

2006-06-07 Thread Ben Clewett
eading, thanks for the URI.) But I am indebted to MySQL for kindly resolving this to work with the DATETIME and return valid data. Possibly two mechanisms would be a 'perfect' solution. The Warnings for the SQL user to show them where their syntax is bad. Then a DBA log to show

Re: DateTime limits

2006-06-06 Thread Michael Stassen
Ben Clewett wrote: > C# has two DateTime constants: > > DateTime.MinValue = '0001-01-01 00:00:00.000' > DateTime.MaxValue = '-12-31 23:59:59.999' > > > MySQL really doe

Re: DateTime limits

2006-06-06 Thread Chris W
Ben Clewett wrote: (I know that TIMESTAMP has a far smaller date range than DATETIME. But all our data has to be time-zone independent. Therefore TIMESTAMP is the only field appropriate for our use.) try and see if this works SELECT * FROM a WHERE cast(t as datetime) > '

Re: DateTime limits

2006-06-06 Thread Ben Clewett
rnings are very useful. When we test code and get a warning, this almost always results in us re-coding. Eg: ... WHERE '2006-06-06' > '2006-06-06 12:00:00' This will give a valid warning, this is bad SQL, time for a re-code! BUT my warning is a special case: - It's

Re: DateTime limits

2006-06-06 Thread Barry
ysql> SHOW WARNINGS; +-+--+-+ | Level | Code | Message| +-+--+-+ | Warning | 1292 | Incorrect datetime value: '0001-01-01 00:00:0

Re: DateTime limits

2006-06-06 Thread Barry
t; be a problem with windows. Windows has his problem using dates before 1st april 1970. Probably this is here going wrong. you can "always" compare ISO datetime formats to timestamps, Datetime fields or whatever. Barry -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^

Re: DateTime limits

2006-06-06 Thread Ben Clewett
ysql> SHOW WARNINGS; +-+--+-+ | Level | Code | Message | +-+--+-+ | Warning | 1292 | Incorrect datetime value: '0001-01-01 00:00:0

Re: DateTime limits

2006-06-06 Thread JamesDR
+ | Level | Code | Message | +-+--+---+ | Warning | 1292 | Truncated incorrect datetime value: '0001-01-01 00:00:00' | +-+--+---+ Scanned by mailCritical.

Re: DateTime limits

2006-06-06 Thread cknipe
Quoting Barry <[EMAIL PROTECTED]>: > Ben Clewett schrieb: > > Hi Barry, > > > > This will happen when comparing against a TIMESTAMP field. > > > > CREATE TABLE a ( t TIMESTAMP ); > > > > SELECT * FROM a WHERE t > '0001-01-01 00:00:00'; > > > > Well my msql doesn't give me any errors using tha

Re: DateTime limits

2006-06-06 Thread Duncan Hill
-+ | Level | Code | Message | +-+--+---+ | Warning | 1292 | Truncated incorrect datetime value: '0001-01-01 00:00:00' | +-+--+

Re: DateTime limits

2006-06-06 Thread Ben Clewett
to solve in future development. C# has two DateTime constants: DateTime.MinValue = '0001-01-01 00:00:00.000' DateTime.MaxValue = '-12-31 23:59:59.999' These are very useful to denote a date always beyond some data, or a date always before some data. Further, C# does no

Re: DateTime limits

2006-06-06 Thread Barry
Ben Clewett schrieb: To whom it may concern, I'm involved in lots of C# coding with several coders. I have a gripe with MySQL which may be easy to solve in future development. C# has two DateTime constants: DateTime.MinValue = '0001-01-01 00:00:00.000' DateTime.MaxValu

DateTime limits

2006-06-06 Thread Ben Clewett
To whom it may concern, I'm involved in lots of C# coding with several coders. I have a gripe with MySQL which may be easy to solve in future development. C# has two DateTime constants: DateTime.MinValue = '0001-01-01 00:00:00.000' DateTime.MaxValue = '999

Re: Help with this query. How to do a group by on a datetime just the month/day/year

2006-05-03 Thread BJ Swope
select count(*), substring(timeofclick,1,7) from MTracking where mallarea=1001 group by 2; On 5/3/06, Randy Paries <[EMAIL PROTECTED]> wrote: Hello, Not sure if i can do this. I have a table with a datetime column I would like to do group by a day of the month. if i do somethin

RE: Help with this query. How to do a group by on a datetime just the month/day/year

2006-05-03 Thread George Law
try: group by substring(timeofclick,1,10) -Original Message- From: Randy Paries [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 03, 2006 11:25 AM To: mysql@lists.mysql.com Subject: Help with this query. How to do a group by on a datetime just the month/day/year Hello, Not sure if i

Help with this query. How to do a group by on a datetime just the month/day/year

2006-05-03 Thread Randy Paries
Hello, Not sure if i can do this. I have a table with a datetime column I would like to do group by a day of the month. if i do something like select count(*) from MTracking where mallarea=1001 group by timeofclick every one is listed because time. So is this possible? Thanks Randy

Re: Problem with datetime value

2006-01-06 Thread Gleb Paharenko
Hello. This is a bug: http://bugs.mysql.com/bug.php?id=16249 Leo wrote: > Hi All, > > I got a problem with a query that involved datetime field. > the table structure goes something like this : > > CREATE TABLE `price_log` (

Problem with datetime value

2006-01-05 Thread Leo
Hi All, I got a problem with a query that involved datetime field. the table structure goes something like this : CREATE TABLE `price_log` ( `Item` char(20) NOT NULL default '', `Started` datetime NOT NULL default 

Re: Problems with indexes on Date/DateTime fields

2006-01-05 Thread Jigal van Hemert
Javier Diaz wrote: EXPLAIN SELECT * FROM process_times WHERE date <= date_sub(now(), INTERVAL 2 day) date_idx,date_proc_idx (NULL) 10778561 EXPLAIN SELECT * FROM process_times WHERE date = date_sub(now(), INTERVAL 2 day) date_idx,date_proc_idx date_idx 1863456 My

RE: Problems with indexes on Date/DateTime fields

2006-01-05 Thread Javier Diaz
NDITIONS] Thanks a lot for your help Javier -Original Message- From: Jigal van Hemert [mailto:[EMAIL PROTECTED] Sent: 05 January 2006 14:39 To: Javier Diaz Cc: Aftab Khan; mysql@lists.mysql.com Subject: Re: Problems with indexes on Date/DateTime fields Javier Diaz wrote: > I would

Re: Problems with indexes on Date/DateTime fields

2006-01-05 Thread Jigal van Hemert
Javier Diaz wrote: I would like to know if there is any problem which cause Mysql to not use date indexes at least you use the "=" operator, because if that is the case we will need to re-visit a few queries If you do a select instead of a delete, will the index be used? (You can check th

RE: Problems with indexes on Date/DateTime fields

2006-01-05 Thread Javier Diaz
hat is the case we will need to re-visit a few queries Thx Javier -Original Message- From: Aftab Khan [mailto:[EMAIL PROTECTED] Sent: 05 January 2006 11:25 To: Javier Diaz Subject: RE: Problems with indexes on Date/DateTime fields I agree. Some time full table scan is faster than

RE: Problems with indexes on Date/DateTime fields

2006-01-05 Thread Javier Diaz
avier -Original Message- From: Aftab Khan [mailto:[EMAIL PROTECTED] Sent: 05 January 2006 11:03 To: Javier Diaz Subject: Re: Problems with indexes on Date/DateTime fields Is not the second quary doing a full table scan? The parser may find this better than using the Index. --- Javier

Problems with indexes on Date/DateTime fields

2006-01-05 Thread Javier Diaz
Hi all We are having a weird problem with some queries which are not using some indexes in date fields. Query-1 SELECT [field list] FROM tableX WHERE dateField = [any date expression or constant value] Query-2 SELECT [field list] FROM tableX WHERE dateField <= [any date expression or constant

Re: DATETIME columns and indexing

2005-11-22 Thread SGreen
"Jonathan Mangin" <[EMAIL PROTECTED]> wrote on 11/22/2005 10:37:00 AM: > (I used to have separate date/time cols. in all tables > but changed them to datetime and buggered up some stuff. > Now I'm trying to find the best way to fix this.) > > If I have an i

DATETIME columns and indexing

2005-11-22 Thread Jonathan Mangin
(I used to have separate date/time cols. in all tables but changed them to datetime and buggered up some stuff. Now I'm trying to find the best way to fix this.) If I have an indexed datetime column (`date`), and say: select date, from table1 where date between '2005-

Datetime with milliseconds?

2005-09-23 Thread Jose Antonio
I'm working on a system that deals with data with second resolution. The data type we are using is not the MySQL DATETIME but the MySQL UNSIGNED INT and we save the datetime as UNIX_TIMESTAMP. By this way we managed to reduce by 4 bytes the storage needs of each record. We also reduce the

Re: querry problem ( datetime => Monday - Sunday )

2005-09-03 Thread inferno
| varchar(13) | | | 0 | | > | date| datetime | | | -00-00 00:00:00 | | > +-+--+--+-+-++ [EMAIL PROTECTED] wrote: &

Re: querry problem ( datetime => Monday - Sunday )

2005-09-03 Thread mfatene
nt | > > | client_name | varchar(100) | | | | > | > > | code| bigint(13) | | | 0 | >

Re: querry problem ( datetime => Monday - Sunday )

2005-09-02 Thread Michael Stassen
| | > | status | varchar(13) | | | 0 | | > | date| datetime | | | -00-00 00:00:00 | | > +-+--+--+-+-++ [EMAIL PROTECTED] wrote: > H

Re: querry problem ( datetime => Monday - Sunday )

2005-09-02 Thread inferno
e- From: inferno [mailto:[EMAIL PROTECTED] Sent: vendredi 2 septembre 2005 22:58 To: mysql@lists.mysql.com Subject: querry problem ( datetime => Monday - Sunday ) Hi, I have a problem: I need to make a select for data that was entered more than 24 hours ago, but in that 24 hours I have to

RE: querry problem ( datetime => Monday - Sunday )

2005-09-02 Thread mfatene
, ...,'Fri'); Hope that helps Mathias -Original Message- From: inferno [mailto:[EMAIL PROTECTED] Sent: vendredi 2 septembre 2005 22:58 To: mysql@lists.mysql.com Subject: querry problem ( datetime => Monday - Sunday ) Hi, I have a problem: I need to make a select for data that

querry problem ( datetime => Monday - Sunday )

2005-09-02 Thread inferno
varchar(13) | | | 0 || | date | datetime| | | -00-00 00:00:00 || ++-+--+-+-++ -- MySQL General Mailing List For lis

Re: Problem with datetime values and MyODBC driver

2005-08-05 Thread Gleb Paharenko
Hello. I was unable to find similar bug in bugs database, but there were several problems with datetime. Some of them were solved by choosing different versions of software. Check if your problem exists on MySQL 4.1.13. Maybe ODBC tracing help you to localize the problem. If you have a

Re: Problem with datetime values and MyODBC driver

2005-08-05 Thread Dušan Pavlica
Sent: Friday, August 05, 2005 6:34 AM Subject: Re: Problem with datetime values and MyODBC driver Dušan Pavlica wrote: Hello, I'm working in C++ Builder 6.0 and I'm trying to create application which could connect through ADO components to different databases using ODBC dri

  1   2   3   4   5   >