Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weird date thing

Status
Not open for further replies.

mousematt

MIS
Feb 5, 2001
102
GB
Hi,
Need some help with a strange date thing.
Am using this below;

INSERT INTO Deliveries (DelInfo,DelDate,PostedBy,PostDate)VALUES('test',14/05/2004,'Matt',16/04/2004)

But the dates keep going into the table as 01/01/1900. Any ideas why??
 
INSERT INTO Deliveries (DelInfo,DelDate,PostedBy,PostDate)VALUES('test','14/05/2004','Matt','16/04/2004')


Thanks

J. Kusch
 
Just comes up with this now.

"The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
The statement has been terminated."

The field its going into is datetime
 
INSERT INTO Deliveries (DelInfo,DelDate,PostedBy,PostDate)VALUES('test','5/14/2004','Matt','4/16/2004')


Thanks

J. Kusch
 
or

Code:
SET DATE_FORMAT dmy

INSERT INTO Deliveries (DelInfo,DelDate,PostedBy,PostDate)VALUES('test','14/05/2004','Matt','16/04/2004')

 
Sorry, should be

Code:
SET [b]DATEFORMAT[/b] dmy

INSERT INTO Deliveries (DelInfo,DelDate,PostedBy,PostDate)VALUES('test','14/05/2004','Matt','16/04/2004')
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top