![]() |
|
|
Insert Date into Access DatabaseWhen inserting a date into an Access database you should use the format
YYYY-MM-DD. The function AccessDate returns a date in YYYY-MM-DD format.
The database is called 'dbDate', the table 'tblDate' and date field 'dDate'. The 'dDate' field is a DATE/TIME datatype. <% Dim connection SQL="INSERT INTO tblDate (dDate) VALUES (#" & AccessDate(NOW()) & "#)" sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _ Insert a date and time into an Access database MM/DD/YYYY means different things to different people. 12/03/1974 to Americans reads as the 3rd of the 12th 1974, to British and Irish it reads the 12th of the 3rd 1974. The only safe format to use is YYYY-MM-DD in Access where there can be no misunderstandings. If you have any code snippets to share with full credit given then send an email to Codesnippets - You'll receive full credit and a link back to your site. Site developed by Michael Wall - Web Design Belfast N.Ireland. |
|