DateFormat To Insert Into Access

Francois

Member
Joined
Nov 27, 2006
Messages
6
Location
South Africa
Programming Experience
1-3
Hallo

I have a problem with the format that i insert a DateTime in a table.

I need to enter a date and time into a table has a field set data type is Date/Time. How how do i enter the current date into that table, how do I change the format???!!! I Tried Date.Now, Date.Today, DateAndTime.Now, DateAndTime.Today, None works!!! Please help! :mad:

Thanx
 
Like lingsn hinted at, if your inserting this via code you have to let the database know your passing a date type object.

You likely have a SQL statement your building like:

sqlCommand = "INSERT INTO [table name] (columnname) VALUES (datevariable)"

What you'll want to add is along the lines of:

sqlCommand = "INSERT INTO [table name] (columnname) VALUES (#" & datevariable & "#)"
 
Back
Top