Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem Appending Date in a Table

Status
Not open for further replies.

RonMcNatt

Technical User
May 22, 2002
32
US
I am trying to append a date into a table, however, when I look at the table it only has 12:00AM for field values. I can look at the value of the variable I'm passing "currentDate" through a message box and it shows up fine "11/14/02."

The table field I'm appending is a datetime type, the variable is declare as a date, the value being looked up is a datetime type.


currentDate = DLookup("DEL_DATE", "TIM1")
sqlString = "INSERT INTO mCBX (DEL_DATE, SLIC ) SELECT " & currentDate & " AS [DEL_DATE], " & currentSlic & " as [SLIC], CBX.* FROM CBX;"
DoCmd.RunSQL sqlString

Note: the "currentSlic" works fine, so I think my format is correct.

Any help would be greatly appreciated!!

Thanks,
Ron

 
Solved the problem, I needed to put #'s around the date.

sqlString = "INSERT INTO mCBX (DEL_DATE, SLIC ) SELECT #" & currentDate & "# AS [DEL_DATE], " & currentSlic & " as [SLIC], CBX.* FROM CBX;"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top