Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: date() function in query


Message #1 by dont worry <aspmailbox@y...> on Wed, 7 Nov 2001 11:49:27 -0800 (PST)
I'm inserting or updating access database date time

field with date() in my sql query, when i

response.write it to the page the correct current date

appears, but when I look in the database i get

12/30/1899 ?  How do I solve and whats the best way to

ensure I always get the current date?



thanks



__________________________________________________

Do You Yahoo!?

Find a job, post your resume.

http://careers.yahoo.com

Message #2 by David Cameron <dcameron@i...> on Thu, 8 Nov 2001 09:41:59 +1100
This message is in MIME format. Since your mail reader does not understand

this format, some or all of this message may not be legible.



------_=_NextPart_001_01C167DD.6DE598A2

Content-Type: text/plain



run FormatDateTime on the date before you insert it. Convert it to

yyyy/mm/dd format. This should do it.



regards

David Cameron

nOw.b2b

dcameron@i...



-----Original Message-----

From: dont worry [mailto:aspmailbox@y...]

Sent: Thursday, 8 November 2001 5:49 AM

To: ASP Databases

Subject: [asp_databases] date() function in query





I'm inserting or updating access database date time

field with date() in my sql query, when i

response.write it to the page the correct current date

appears, but when I look in the database i get

12/30/1899 ?  How do I solve and whats the best way to

ensure I always get the current date?



thanks



__________________________________________________

Do You Yahoo!?

Find a job, post your resume.

http://careers.yahoo.com



 




$subst('Email.Unsub')




Message #3 by "Ken Schaefer" <ken@a...> on Thu, 8 Nov 2001 15:20:40 +1100
You are using incorrect delimiters:



http://www.adopenstatic.com/faq/80040e14.asp#scenario4



explains what happens when you fail to use # delimiters for dates - whenever

you get a year that ends in 00 (eg 2000), you get a division by zero error.



You are inserting your date as a number (eg 5/11/2001, which is 5 divided by

11 divided by 2001 which is a very small number, and is only a few

milliseconds after 30th December 1899, which is the earliest date supported

by that type of field.



Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From: "dont worry" <aspmailbox@y...>

Subject: [asp_databases] date() function in query





: I'm inserting or updating access database date time

: field with date() in my sql query, when i

: response.write it to the page the correct current date

: appears, but when I look in the database i get

: 12/30/1899 ?  How do I solve and whats the best way to

: ensure I always get the current date?



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




  Return to Index