473,322 Members | 1,614 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Date format problem...

Isn't the following date format supposed to work with any installation of
MySQL?

YYYY-MM-DD HH:NN:SS

It's not working on one system... the date is shown as all zero's.
Jul 20 '05 #1
6 2309
Greg wrote:
Isn't the following date format supposed to work with any installation of
MySQL?

YYYY-MM-DD HH:NN:SS

It's not working on one system... the date is shown as all zero's.


Can you show example how to make it show all zeros? I would like to see
something like this (Except in my example the datetime seems to work fine):
mysql> create table datetimetest( col1 datetime );
Query OK, 0 rows affected (0.02 sec)

mysql> insert into datetimetest values( now() );
Query OK, 1 row affected (0.00 sec)

mysql> insert into datetimetest values( '2000-01-01 10:10:22' );
Query OK, 1 row affected (0.00 sec)

mysql> select * from datetimetest;
+---------------------+
| col1 |
+---------------------+
| 2004-07-30 19:59:38 |
| 2000-01-01 10:10:22 |
+---------------------+
2 rows in set (0.01 sec)
Jul 20 '05 #2
Greg wrote:
Isn't the following date format supposed to work with any installation of
MySQL?

YYYY-MM-DD HH:NN:SS

It's not working on one system... the date is shown as all zero's.


Do you mean the date format when inserting, as in:
insert into myTable (myDateColumn) values("2004-07-30 10:48:00");

or do you mean the date format when selecting, as in:
select date_format(myDateColumn, "%Y-%m-%d %T") from myTable;

Regards,
Bill K.
Jul 20 '05 #3
"Bill Karwin" <bi**@karwin.com> wrote in message
news:ce********@enews3.newsguy.com...
Greg wrote:
Isn't the following date format supposed to work with any installation of MySQL?

YYYY-MM-DD HH:NN:SS

It's not working on one system... the date is shown as all zero's.


Do you mean the date format when inserting, as in:
insert into myTable (myDateColumn) values("2004-07-30 10:48:00");

or do you mean the date format when selecting, as in:
select date_format(myDateColumn, "%Y-%m-%d %T") from myTable;

Regards,
Bill K.


Like your first example. It happens when doing it from an application.
This is happening with MySQL v4.1 beta on one system (other systems are
using v4.0)
Jul 20 '05 #4
Greg wrote:
Like your first example. It happens when doing it from an application.
This is happening with MySQL v4.1 beta on one system (other systems are
using v4.0)


Echo/Print out the exact query (filled with values, not those containing
$variable or stuff like that) you are using and copy-paste it here.
Because most common reason for problems like this is that the query is
incorrectly formed.
Jul 20 '05 #5
"Bill Karwin" <bi**@karwin.com> wrote in message
news:ce********@enews3.newsguy.com...
Greg wrote:
Isn't the following date format supposed to work with any installation of MySQL?

YYYY-MM-DD HH:NN:SS

It's not working on one system... the date is shown as all zero's.


Do you mean the date format when inserting, as in:
insert into myTable (myDateColumn) values("2004-07-30 10:48:00");

or do you mean the date format when selecting, as in:
select date_format(myDateColumn, "%Y-%m-%d %T") from myTable;

Regards,
Bill K.


Like your first example. It happens when doing it from an application.
This is happening with MySQL v4.1 beta on one system (other systems are
using v4.0)
Jul 20 '05 #6
Greg wrote:
Like your first example. It happens when doing it from an application.
This is happening with MySQL v4.1 beta on one system (other systems are
using v4.0)


Echo/Print out the exact query (filled with values, not those containing
$variable or stuff like that) you are using and copy-paste it here.
Because most common reason for problems like this is that the query is
incorrectly formed.
Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: amith | last post by:
hi I have written javascript for comparing two dates in US format and finding out whether the start date is greater than the end date and vice versa. In this attempt i have instantiated the...
6
by: Dario Di Bella | last post by:
Hi all, we have the following urgent issue affecting our development team. Initially we had one particular workstation that failed executing queries on a DB2 database, raising an invalid date...
3
by: Lyn | last post by:
Hi, I am developing a project in which I am checking for records with overlapping start/end dates. Record dates must not overlap date of birth, date of death, be in the future, and must not...
7
by: James P. | last post by:
Hello there, In my asp.net page using VB, I have a date text field in mm/dd/yyyy format. When a date is entered, I'd like to validate it to make sure the date is greater than or equal to the...
12
by: Assimalyst | last post by:
Hi, I have a working script that converts a dd/mm/yyyy text box date entry to yyyy/mm/dd and compares it to the current date, giving an error through an asp.net custom validator, it is as...
16
by: Mik | last post by:
I apologise if this post seems a little basic, but I am a newbie and have NO access knowledge. I have downloaded the Accounts Ledger from the Microsoft Website. It allows the user to review a...
7
by: creative1 | last post by:
Hello everyone. I am experiencing a strange problem that I can't fix on my own. I think I need expert's suggestions for this. The problem is: I want to print account statement (or any other...
30
by: fniles | last post by:
On my machine in the office I change the computer setting to English (UK) so the date format is dd/mm/yyyy instead of mm/dd/yyyy for US. This problem happens in either Access or SQL Server. In the...
4
by: OzNet | last post by:
I have some functions to calculate the working days in a given period. This includes a table that is queried to calculate the number of public holidays that don’t occur on a weekend. If I test...
11
ollyb303
by: ollyb303 | last post by:
Hello, I am using a dynamic crosstab report to track performance statistics for my company and I have hit a problem. I would like the option to track stats daily (for the last 7 complete...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.