ColdFusion Tutorial
Insert and retrieve a date from Access database
If you need to insert a date into the date/time field in your Access database.
Approach this either by inserting a properly formatted string or create one yourself.
Either way will work.
Access will convert into a date/time object.
Example code:
<cfset Your_Date1 = DateFormat(now(),'m/d/yy')>
<cfset Your_Date2 = DateFormat(now(),'mm/dd/yyyy')&" "&TimeFormat(now(),'HH:mm:ss')>
<cfset Your_Date3 = CreateODBCDate(now())>
<cfquery name = "insert" database = "your_database">
INSERT INTO Your_Table (Date1, Date2, Date3)
VALUES ('#Your_Date1#',#Your_Date2,#Your_Date3)
</cfquerry>
ColdFusion Tutorial test
Insert and retrieve a date from Access database
No test is available or implemented for this ColdFusion Tutorial.
User Comments: 1
good
good
