Image

Imageenslore wrote in Imagewebdev

Trouble with dates

I've got some date strings in a combo box, in the format "dd MMM yyyy". I'm converting these using the datevalue function, and putting them into Access.

Somehow during this process, "05 Feb 2004" is coming back as "30 Dec 1899". I've checked the datevalue function by writing it out to the page, and that comes back as "05/02/2004 00:00:00". I've then tried putting that into Access via code in Access, and again it's coming out right.

However, if I do all the code in asp and then go look in the Access table I have 30/12/1899. Anybody have any idea what the hell is happening?

Update: Solved by putting the datevalue itself into the SQL string rather than using it as a function and putting the result into the string. Still would like to know what was happening though. Something to do with the SQL presumably?