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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is this a Date format problem

Status
Not open for further replies.

modalman

Programmer
Feb 14, 2001
156
GB
Hi. I have a form that with a few text boxes in Access 97. One of them is set to recieve a 'General Date'. When the button is clicked the following code tries to write the form fields to my db:

DoCmd.RunSQL ("INSERT INTO WageAccounts (WorkerID, Date, Earnt) VALUES(" & [WorkerID] & ", '" & [Date] & "', " & [Earnt] & ");")

This throws up an error but works perfect if the Date field is excluded. The db field is formatted as a Date field as well. Do I need something else in the SQL string to modify the Date before it goes to the db? Many thanks in advance. ASCII silly question, get a silly ANSI
 
Dates should be surrounded by #s instead of quotes. Maq B-)
<insert witty signature here>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top