> On Apr 14, 2017, at 1:07 PM, shawn l.green wrote:
>
> That all depends. Do you...
Hi Shawn,
I thought I had replied to your response, but it looks like I didn’t.
Thank you for your email. It was a thorough response and the links were very
helpful, as well. I’ve settled on both DA
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)
Ah ok I rechecked the documentation for BETWEEN which includes additional
information not mentioned on the type conversion page:
For best results when using BETWEEN with date or time values, you should use
CAST() to explicitly convert the values to the desired data type. Examples:
If you compare
Thanks for the replies all (and for the blog link - one to add to my feeds I
think).
Yes I spotted that adding the leading zero to the month yields the correct
result here, but I think I know why.
If you imagine BETWEEN using a string comparison here then the results for
with and without leading
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 conve
Hi Rob,
Rob Desbois wrote:
I am having issues with type conversion not working as expected per the
documentation.
I am using in MySQL 5.0.27 for x86/Windows.
The documentation at
http://dev.mysql.com/doc/refman/5.0/en/type-conversion.html states that for
comparison operators "If one of the argu
I'm not sure specifically why it's acting the way it is, but it looks
like it's converting your date strings slightly differently depending on
how you use them.
If you properly pad the month out in the two strings it seems to work.
SELECT '2007-05-24 00:00:00' BETWEEN ('2007-03-23' - INTERVAL
Willy wrote:
Hello,
I have a MyISAM table:
CREATE TABLE `dlr` (
`msisdn` varchar(20) NOT NULL default '',
`source` varchar(20) NOT NULL default '',
`operator_id` varchar(20) NOT NULL default '',
`sms_message` longtext NOT NULL,
`smsc_id` varchar(20) NOT NULL default '',
`sms_id` varc
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(20
Thanks for the information.
I agree with what you say.
There is just one comment I'd like to make.
You are right that the TIMESTAMP has a specific range. I am comparing
it to a date outside that range. This could cause problems.
But I strongly believe that the SQL user, who in many cases i
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 doesn't like these values, it shows warnings:
>
> +-+--+-+
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) > '0001-01-
Hi Barry,
> Well removing 'explicit' warnings for every user having problems with
> 3rd party modules would have mysql without any warnings nowadays ;)
>
> i think that your mono should get more stable.
I completely take this on board. This is a bug outside MySQL.
Warnings are very useful. Wh
Ben Clewett schrieb:
Hi Barry,
This is what I get:
mysql> CREATE TABLE a ( t TIMESTAMP );
Query OK, 0 rows affected (0.25 sec)
mysql> SELECT * FROM a WHERE t > '0001-01-01 00:00:00';
Empty set, 1 warning (0.00 sec)
mysql> SHOW WARNINGS;
+-+--+--
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 that query.
neither a warning.
This "might" be a problem with windows.
Wi
Hi Barry,
This is what I get:
mysql> CREATE TABLE a ( t TIMESTAMP );
Query OK, 0 rows affected (0.25 sec)
mysql> SELECT * FROM a WHERE t > '0001-01-01 00:00:00';
Empty set, 1 warning (0.00 sec)
mysql> SHOW WARNINGS;
+-+--+
Duncan Hill wrote:
On Tuesday 06 June 2006 15:38, [EMAIL PROTECTED] wrote:
Quoting Barry <[EMAIL PROTECTED]>:
Well my msql doesn't give me any errors using that query.
neither a warning.
Ditto.
usemysql> use test;
Database changed
mysql> CREATE TABLE a ( t TIMESTAMP );
Query OK, 0 rows affect
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
On Tuesday 06 June 2006 15:38, [EMAIL PROTECTED] wrote:
> Quoting Barry <[EMAIL PROTECTED]>:
> > Well my msql doesn't give me any errors using that query.
> > neither a warning.
>
> Ditto.
>
> usemysql> use test;
> Database changed
> mysql> CREATE TABLE a ( t TIMESTAMP );
> Query OK, 0 rows affecte
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';
I understand that TIMESTAMP cannot handle this date. But I would hope
to be able to compare against this date without MySQL giving the
warnin
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.MaxValue = '-12-31
"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 indexed datetime column (`date`), and sa
Hello.
According to the output of mysqld --help --verbose these variables
(date_format and datetime_format) don't work yet, they're exists
for future purposes.
[EMAIL PROTECTED] wrote:
> Mike,
> Have you tried creating a new table with a field for some sort of date?
> Try adding som
Mike,
Have you tried creating a new table with a field for some sort of date?
Try adding some data and see if the new date time format you specified in
the my.cnf file. See if that works.
-sam
> Hello,
>
> Nevermind - duh -datetime is not timestamp (oneday I fullfill my promise
> to myself and n
Hello,
Nevermind - duh -datetime is not timestamp (oneday I fullfill my promise to
myself and not work on Sundays when my 'duh' level is a bit higher).
Sofrom what I gather, the backward compatibility comes in the form of
adding a +0 (string to int).
This is most inconvenient and annoy
From: "DePhillips, Michael P"
> Am I gaining anything by using a timestamp instead of using dateTime and
> calling now(), for example, increased performance, better indexing, etc.
> I guess another way to ask this is does the MySQL internals handle a
> timestamp more efficiently than a dateTime.
I
IMO, dateTime doesn't parse now() the same way that timeStamp does. If you
use now() in a dateTime field, I have found that it doesn't always write the
time to the record, while using now() with the timestamp always does.
As far as your other questions, the indexing and increased performance, I
ha
Pintér Tibor (tibyke) wrote:
Select * from where date > _2005-01-07_ and date <
DATE_ADD(_2005-01-07_, INTERVAL 24 HOUR)
However is there a simpler way of doing it by just passing one date like
Select * from where date = _2005-01-07_
you may also go for "... WHERE year(foo)=a AND month(foo)=b AN
In article <[EMAIL PROTECTED]>,
"Pete Moran" <[EMAIL PROTECTED]> writes:
> Hi All,
> Is there a simpler way of doing a select for a given date, for instance if I
> have a datetime field called date
> And so its populated with a load of values such as
> 2005-01-07 09:00
> 2005-01-07 10:00
> 200
> Select * from where date > _2005-01-07_ and date <
> DATE_ADD(_2005-01-07_, INTERVAL 24 HOUR)
>
> However is there a simpler way of doing it by just passing one date like
>
> Select * from where date = _2005-01-07_
you may also go for "... WHERE year(foo)=a AND month(foo)=b AND
dayofmonth(f
Thanks Michael,
This way works fine anyway was just interested if there was a better way of
doing it.
Pete
-Original Message-
From: Michael Stassen [mailto:[EMAIL PROTECTED]
Sent: Monday, 21 March 2005 4:07 PM
To: Pete Moran
Cc: mysql@lists.mysql.com
Subject: Re: DateTime Select
vid Logan
Database Administrator
HP Managed Services
148 Frome Street,
Adelaide 5000
Australia
+61 8 8408 4273 - Work
+61 417 268 665 - Mobile
+61 8 8408 4259 - Fax
-Original Message-
From: Pete Moran [mailto:[EMAIL PROTECTED]
Sent: Monday, 21 March 2005 11:22 AM
To: Logan, David (SST - Adelaide
Pete Moran wrote:
Hi All,
Is there a simpler way of doing a select for a given date, for instance if I
have a datetime field called date
And so its populated with a load of values such as
2005-01-07 09:00
2005-01-07 10:00
2005-01-07 11:00
2005-01-07 12:00
If I wanted all records which fall on 200
: Monday, 21 March 2005 11:22 AM
To: Logan, David (SST - Adelaide)
Cc: mysql@lists.mysql.com
Subject: RE: DateTime Select optimised
Will try with the partial index,
Comparing the two without it is as follows
Using Like
mysql> explain select count(*) from trip where
Adelaide) [mailto:[EMAIL PROTECTED]
Sent: Monday, 21 March 2005 11:43 AM
To: Pete Moran
Cc: mysql@lists.mysql.com
Subject: RE: DateTime Select optimised
I would investigate a partial index perhaps on the date only? You could
index on just the date eg.
ALTER TABLE ADD INDEX (date(10));
I don't ha
To: Logan, David (SST - Adelaide); mysql@lists.mysql.com
Subject: RE: DateTime Select optimised
The table is indexed on the date field, doing a 'like' results in a
table
scan, is there another way similar principal but would allow the indexes
to
be used ?
-Original Message-
Fro
M
To: Pete Moran; mysql@lists.mysql.com
Subject: RE: DateTime Select optimised
SELECT * FROM WHERE date LIKE '2005-01-07%';
David Logan
Database Administrator
HP Managed Services
148 Frome Street,
Adelaide 5000
Australia
+61 8 8408 4273 - Work
+61 417 268 665 - Mobile
+61 8 8408 4259 -
SELECT * FROM WHERE date LIKE '2005-01-07%';
David Logan
Database Administrator
HP Managed Services
148 Frome Street,
Adelaide 5000
Australia
+61 8 8408 4273 - Work
+61 417 268 665 - Mobile
+61 8 8408 4259 - Fax
-Original Message-
From: Pete Moran [mailto:[EMAIL PROTECTED]
Sent: Mon
Hi, Jan!
--- Jan Pfeifer wrote: ---
> hi all,
>
> I've just upgraded one of the replicate servers from 4.0.22 to 4.1.7,
> just as a test before upgrading all the others.
> Apparently I had just this problem: datetime data inserted in ISO format
> is not accepted -- strings like '20041210T10420
* Håkan Elmqvist
> Is there any MySQL built in function to convert datetime types to
> real numbers (float) i.e. seconds or days since a reference date?
> I can't find any in the manual.
There are plenty of date and time manipulating functions available. Take a
look at to_days() and unix_timestamp
At 11:01 +0300 on 05/26/2004, Egor Egorov wrote about Re: DATETIME question:
John Mistler <[EMAIL PROTECTED]> wrote:
Given a column DATETIMEcolumn (-MM-DD HH:MM:SS), is there a SELECT
statement that will:
select all entries whose (TIME) of DATETIMEcolumn is BETWEEN 'HH:MM:SS'
Use the time_format function.
-Original Message-
From: John Mistler
To: [EMAIL PROTECTED]
Sent: 5/26/04 1:15 AM
Subject: DATETIME question
Given a column DATETIMEcolumn (-MM-DD HH:MM:SS), is there a SELECT
statement that will:
select all entries whose (TIME) of DATETIMEcolumn is BETW
John Mistler <[EMAIL PROTECTED]> wrote:
> Given a column DATETIMEcolumn (-MM-DD HH:MM:SS), is there a SELECT
> statement that will:
>
> select all entries whose (TIME) of DATETIMEcolumn is BETWEEN 'HH:MM:SS' AND
> 'HH:MM:SS', but whose (DATE) is anything?
>
SELECT .. FROM t1 WHERE DATE_FORMA
You can specify the date (Datetime or Timestamp) format when creating
table as follows:
Type=>Format
-
DATETIME => -MM-DD HH:MM:SS
DATE => -MM-DD
TIME => HH:MM:SS
YEAR =>
TIMESTAMP
---
TIMESTAMP(14) => MMDDHHMMSS
TIMESTAMP(12) => YY
[EMAIL PROTECTED] wrote:
> Hi All,
>Can you specify what format to use for the datetime column eg.
> in oracle you can say I wanna use DD-MMM- HH:MM:SS and so on?
>
No.
You can use DATE_FORMAT() function to format date values when you retrieve data:
http://dev.mysql.com/d
On Thursday 22 April 2004 12:56, [EMAIL PROTECTED] might have typed:
> Hi All,
> Can you specify what format to use for the datetime column eg.
> in oracle you can say I wanna use DD-MMM- HH:MM:SS and so on?
If you read the manual, you will see that the column is formatted in one wa
At 20:23 -0400 4/19/04, Stormblade wrote:
On Mon, 19 Apr 2004 17:36:50 -0500, Paul DuBois wrote:
Sorry if I wasn't clear. One of the things you wanted to do was have
a column that is set automatically to record-creation time when the
record is created, but not updated automatically when the re
On Mon, 19 Apr 2004 17:36:50 -0500, Paul DuBois wrote:
> Sorry if I wasn't clear. One of the things you wanted to do was have
> a column that is set automatically to record-creation time when the
> record is created, but not updated automatically when the record is
> updated later. You will be
At 17:55 -0400 4/19/04, Stormblade wrote:
On Sun, 18 Apr 2004 14:18:40 -0500, Paul DuBois wrote:
At 13:30 -0400 4/18/04, Stormblade wrote:
On Sun, 18 Apr 2004 12:17:00 -0400, Michael Stassen wrote:
Stormblade wrote:
Hey all,
I'm currently converting a SQLServer 2000 database over to
MyS
On Sun, 18 Apr 2004 14:18:40 -0500, Paul DuBois wrote:
> At 13:30 -0400 4/18/04, Stormblade wrote:
>>On Sun, 18 Apr 2004 12:17:00 -0400, Michael Stassen wrote:
>>
>>> Stormblade wrote:
>>>
Hey all,
I'm currently converting a SQLServer 2000 database over to MySQL. I have a
w
At 13:30 -0400 4/18/04, Stormblade wrote:
On Sun, 18 Apr 2004 12:17:00 -0400, Michael Stassen wrote:
Stormblade wrote:
Hey all,
I'm currently converting a SQLServer 2000 database over to MySQL. I have a
web application that currently uses SQLServer but will be using MySQL soon
as I can get
At 13:30 -0400 4/18/04, Stormblade wrote:
On Sun, 18 Apr 2004 12:17:00 -0400, Michael Stassen wrote:
Stormblade wrote:
Hey all,
I'm currently converting a SQLServer 2000 database over to MySQL. I have a
web application that currently uses SQLServer but will be using MySQL soon
as I can get
On Sun, 18 Apr 2004 14:42:51 -0400, Michael Stassen wrote:
> Stormblade wrote:
>
>> On Sun, 18 Apr 2004 12:17:00 -0400, Michael Stassen wrote:
> Functions are evaluated by the server. The client only sends queries and
> receives results. So, CURDATE() and NOW() are server time, not client tim
On Sun, 18 Apr 2004 13:54:22 -0400, Rhino wrote:
> Stormblade (and anyone watching this thread),
>
> Just watch yourself when deciding between DATETIME and TIMESTAMP; the two
> datatypes support very different ranges of values!
Thanks for the heads up!
>
> According to the manual, DATETIME can
Stormblade wrote:
On Sun, 18 Apr 2004 12:17:00 -0400, Michael Stassen wrote:
Stormblade wrote:
Hey all,
I'm currently converting a SQLServer 2000 database over to MySQL. I have a
web application that currently uses SQLServer but will be using MySQL soon
as I can get this done.
I was able to m
t what values you'll have to store before you make a
final choice of the datatype.
Rhino
- Original Message -
From: "Stormblade" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, April 18, 2004 1:30 PM
Subject: Re: Datetime Default Value
> On Sun
On Sun, 18 Apr 2004 12:17:00 -0400, Michael Stassen wrote:
> Stormblade wrote:
>
>> Hey all,
>>
>> I'm currently converting a SQLServer 2000 database over to MySQL. I have a
>> web application that currently uses SQLServer but will be using MySQL soon
>> as I can get this done.
>>
>> I was able
Stormblade wrote:
Hey all,
I'm currently converting a SQLServer 2000 database over to MySQL. I have a
web application that currently uses SQLServer but will be using MySQL soon
as I can get this done.
I was able to match data types but so far I have not found a way to let the
database handle sett
Changing the SQL works fine as long as:
a) You have access to the application source and/or the SQL source
b) There is only one application and it runs on the same machine as the
database.
If you change your SQL what happens if you have several applications all in
different timezones that use the
This is a great question! I also work on SQL Server (2k) databases as
well as Access and MySQL. I run into the same problem. So far, I've
just changed the SQL in my applications, but I also would like to know
if a default can be set.
Regards,
Adam
On Apr 18, 2004, at 12:01 AM, Stormblade wrote:
CurlyBraces Technologies ( Pvt ) Ltd wrote:
hi ,
i have created datetime field in the field name "abc".
so i want to get the system date and time automatically to the abc field for in each
records. how can i do that ?can somebody help me ..plz
define the column as timestamp
--
TED]
Sent: Friday, February 27, 2004 7:09 AM
Subject: Fw: datetime in mysql
- Original Message -
From: CurlyBraces Technologies ( Pvt ) Ltd
To: mos
Sent: Friday, February 27, 2004 11:51 AM
Subject: Re: datetime in mysql
sorry , as u said , i did it . it doesn't
"Jacque Scott" <[EMAIL PROTECTED]> wrote:
>
> I have a DateTime data type for one of my fields. If an entry is being
> INSERTed then I want the DateTime to be NOW(). I want this done
> automatically and not have to set me SQL str to do this. I have tried
> to set the default as NOW() but it wil
Oops, I didn't mean "datetime as index", but "like with datetime" is
broken in 4.1.1.
On Tue, 16 Dec 2003 03:12:20 +0900
Tatsuhiko Miyagawa <[EMAIL PROTECTED]> wrote:
> Seems like a bug in 4.1.1-alpha using datetime as index.
>
>
> mysql> create table foo (d datetime, index (d));
> Query OK, 0
Thanks Joakim and to all who have helped me on this topic; all is
working properly under 4.0.16.
Elton
On Dec 1, 2003, at 6:48 PM, Joakim Ryden wrote:
On 12/1/03 4:42 PM Elton wrote:
Joakim,
The "mysql-standard-4.0.16.dmg" installer release notes says,
"Beginning with MySQL 4.0.11, you can ins
On 12/1/03 4:42 PM Elton wrote:
Joakim,
The "mysql-standard-4.0.16.dmg" installer release notes says,
"Beginning with MySQL 4.0.11, you can install MySQL on Mac OS X 10.2
("Jaguar") using a Mac OS X `PKG' binary package instead of the binary
tarball distribution. Please note that older versions
Joakim,
The "mysql-standard-4.0.16.dmg" installer release notes says,
"Beginning with MySQL 4.0.11, you can install MySQL on Mac OS X 10.2
("Jaguar") using a Mac OS X `PKG' binary package instead of the binary
tarball distribution. Please note that older versions of Mac OS X (for
example, 10.1.x)
That's strange. To test my "datetime ORDER BY is erred", as mentioned,
I only ran the installer for the "mysql-standard-4.0.16.dmg";
installing it on my OSX_10.3.1 cpu, that had no prior installation --
and its working.
The install notes for
"mysql-standard-4.0.16-apple-darwin6.6-powerpc.tar"
On 12/1/03 3:50 PM Elton wrote:
If I'm installing on Panther_Server, to upgrade 4.0.14, what file is
correct:
mysql-standard-4.0.16
mysql-standard-4.0.16-apple-darwin6.6-powerpc.tar
Both. The tar file is a tar archive and the pkg file is a Mac OS X
pacjage. :)
--Jo
--
MySQL General Mailing Lis
If I'm installing on Panther_Server, to upgrade 4.0.14, what file is
correct:
mysql-standard-4.0.16
mysql-standard-4.0.16-apple-darwin6.6-powerpc.tar
Elton
On Dec 1, 2003, at 5:37 PM, Elton wrote:
I downloaded a the 4.0.16 from mysql.com (a .dmg file), ran the
installer on my local 10.3.1 cpu
I downloaded a the 4.0.16 from mysql.com (a .dmg file), ran the
installer on my local 10.3.1 cpu (not the server) -- did not want to
mess-up my server.
However, I did not compile anything, just ran the install.pkg. Will
installer work as a upgrade to my Panther_server's 4.0.14?
By the way, I
On Dec 01, 2003, at 14:35, Elton wrote:
So, maybe it was a bug that was fixed in 4.0.16; how do I upgrade to
v4.0.16? I'm sort of a novice with MySQL and am using what was
pre-installed with Apple's Panther_server -- have never installed it
myself.
Elton,
I've had some weird issues with the d
So, maybe it was a bug that was fixed in 4.0.16; how do I upgrade to
v4.0.16? I'm sort of a novice with MySQL and am using what was
pre-installed with Apple's Panther_server -- have never installed it
myself.
Elton
On Dec 1, 2003, at 1:18 PM, Victoria Reznichenko wrote:
Elton <[EMAIL PROTECT
Elton <[EMAIL PROTECTED]> wrote:
>
> Oops, my pasted graphic did not pass; here is what I get:
>
> mysql> select date_close,aircraft,route from Avail_Legs Order By
> date_close;
> +-+--+---+
> | date_close | aircraft | route |
> +-
I'm sure this won't matter, but did you try putting a "order by date_close
DESC" or "ASC"?
Daevid Vincent
http://daevid.com
> -Original Message-
> From: Elton [mailto:[EMAIL PROTECTED]
> Sent: Monday, December 01, 2003 9:04 AM
> To: [EMAIL P
Oops, my pasted graphic did not pass; here is what I get:
mysql> select date_close,aircraft,route from Avail_Legs Order By
date_close;
+-+--+---+
| date_close | aircraft | route |
+-+--+---+
| 2003-11-01 14:00:00
At 23:10 -0500 6/24/03, MaFai wrote:
Hello, mysql,
A table contains a column named "mydate".
//Wrong sql statement
alter table p_asset add mydate datetime default now();
alter table p_asset add mydate datetime default time();
alter table p_asset add mydate datetime de
The TIMESTAMP column type does this for you:
See: http://www.mysql.com/doc/en/DATETIME.html
Regards,
Mike Hillyer
www.vbmysql.com
> -Original Message-
> From: MaFai [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 24, 2003 11:01 AM
> To: [EMAIL PROTECTED]
> Subject: datetime column dumm
Also doesnt work in 4.1 alpha.
Best regards
Nils Valentin
Tokyo/Japan
(As requested I took Roman of , as he doesnt like direct e-mails ;-)
2003年 6月 25日 水曜日 19:12、Roman Neuhauser さんは書きました:
> # [EMAIL PROTECTED] / 2003-06-25 06:18:04 +0100:
> > Sometime recently MaFai said:
> > > A table contai
# [EMAIL PROTECTED] / 2003-06-25 07:10:46 +0100:
> Sometime recently Roman Neuhauser said:
> > # [EMAIL PROTECTED] / 2003-06-25 06:18:04 +0100:
> > > alter table p_asset add mydate datetime default 'now()';
> > >
> > > - you need the '' around now(); apparently
> > >
> > > http://www.mysql.com/d
You're right, just tested it myself on 3.23.41; and I get exactly
the same result as you. We should post an amendment to the docs
on the website.
However, (still with 3.23.41):
mysql> create table autotime2 (foo int, bar timestamp default now());
ERROR 1064: You have an error in your SQL syntax
# [EMAIL PROTECTED] / 2003-06-25 06:18:04 +0100:
> Sometime recently MaFai said:
> > A table contains a column named "mydate".
> >
> > //Wrong sql statement
> > alter table p_asset add mydate datetime default now();
> > alter table p_asset add mydate datetime default time();
>
alter table p_asset add mydate datetime default 'now()';
- you need the '' around now(); apparently
http://www.mysql.com/doc/en/DATETIME.html
and scroll down to the comment made by
Lazy Soul on Tuesday May 27 2003, @8:15am
Jan
Janice Wright
Ingenta plc
[EMAIL PROTECTED]
http://www.ingentase
# [EMAIL PROTECTED] / 2003-06-25 12:05:49 +0800:
> //Wrong sql statement
> alter table p_asset add mydate datetime default now();
> alter table p_asset add mydate datetime default time();
> alter table p_asset add mydate datetime default now;
> alter table p_asset add myda
On Thu, Mar 13, 2003 at 10:47:05AM -0700, Jason Brothers wrote:
>
> > - portability -- code using unixtime is less likely to rely on MySQL's
> > date functions, and more easily ported to PostgreSQL, Foxbase, etc.
>
> I thought the Datetime function in MySQL was based on the ANSI SQL99
> standar
> - portability -- code using unixtime is less likely to rely on MySQL's
> date functions, and more easily ported to PostgreSQL, Foxbase, etc.
I thought the Datetime function in MySQL was based on the ANSI SQL99
standard? Shouldn't it be portable to other systems that support this
standard?
Ja
On 13 Mar 2003, at 10:47, Jason Brothers wrote:
> > - portability -- code using unixtime is less likely to rely on
> > MySQL's date functions, and more easily ported to PostgreSQL,
> > Foxbase, etc.
>
> I thought the Datetime function in MySQL was based on the ANSI SQL99
> standard? Shouldn't it
t;[EMAIL PROTECTED]>
Sent: Thursday, March 13, 2003 8:34 AM
Subject: Re: Datetime vs Unixtime
> On 12 Mar 2003, at 22:25, Jason Brothers wrote:
>
> > I am just looking for feedback whether to use Datetime or
> > Unixtime (32 bit Int) for my timestamps.
>
> You le
At 11:56 -0500 3/13/03, walt wrote:
Paul DuBois wrote:
At 10:34 -0500 3/13/03, Keith C. Ivey wrote:
>I am curious why a DATE takes 3 bytes and a TIME takes 3 bytes, but a
>DATETIME takes 8 bytes, even though TIME covers a much greater range
>than the time part of a DATETIME, but that's just on
Paul DuBois wrote:
> At 10:34 -0500 3/13/03, Keith C. Ivey wrote:
> >I am curious why a DATE takes 3 bytes and a TIME takes 3 bytes, but a
> >DATETIME takes 8 bytes, even though TIME covers a much greater range
> >than the time part of a DATETIME, but that's just one of the
> >mysteries of MySQL t
On 13 Mar 2003, at 10:20, Paul DuBois wrote:
> At 10:34 -0500 3/13/03, Keith C. Ivey wrote:
> >I am curious why a DATE takes 3 bytes and a TIME takes 3 bytes, but a
> >DATETIME takes 8 bytes, even though TIME covers a much greater range
> >than the time part of a DATETIME, but that's just one of t
At 10:34 -0500 3/13/03, Keith C. Ivey wrote:
I am curious why a DATE takes 3 bytes and a TIME takes 3 bytes, but a
DATETIME takes 8 bytes, even though TIME covers a much greater range
than the time part of a DATETIME, but that's just one of the
mysteries of MySQL that's probably not worth losing sl
On 12 Mar 2003, at 22:25, Jason Brothers wrote:
> I am just looking for feedback whether to use Datetime or
> Unixtime (32 bit Int) for my timestamps.
You left out a major advantage of Unix time: you don't have to worry
about changing time zones or daylight saving time. MySQL DATETIME
doesn't
At 22:25 -0700 3/12/03, Jason Brothers wrote:
Hello,
I apologize if this topic has been discussed in the past. I am just looking
for feedback whether to use Datetime or Unixtime (32 bit Int) for my
timestamps. From what I can tell here are the advantages and disavantages
of each method:
Unixtim
On Wed, Mar 12, 2003 at 10:25:11PM -0700, Jason Brothers wrote:
>
> I apologize if this topic has been discussed in the past. I am just looking
> for feedback whether to use Datetime or Unixtime (32 bit Int) for my
> timestamps. From what I can tell here are the advantages and disavantages
> of
: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 ignores the indexes
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 violation. I foun
On 3 Dec 2002, at 10:45, Peter Abilla wrote:
> Column One Column Two
> 1999-09-17 16:30:18 1999-09-18 13:30:18
>
> I want to calculate the minutes like
>
> (Column Two - Column One) = Total Minutes
Something like ( UNIX_TIMESTAMP(column2) - UNIX_TIMESTAMP(column1) ) / 60 ?
> K
Try this:
select sec_to_time(unix_timestamp(column_two) - unix_timestamp(column_one))
Should give you the elapsed time in hh:mm:ss format.
--jeff
- Original Message -
From: "Peter Abilla" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 03, 2002 8:45 AM
Subject: DateT
On 12/3/02 10:45 AM, Peter Abilla ([EMAIL PROTECTED]) wrote:
> Suppose I have a datetime in the following format:
>
> Column One Column Two
> 1999-09-17 16:30:18 1999-09-18 13:30:18
>
> I want to calculate the minutes like
>
> (Column Two - Column One) = Total Minutes
>
> I've
1 - 100 of 128 matches
Mail list logo