Link to home
Start Free TrialLog in
Avatar of laurap
laurap

asked on

Insert Into statment - Error 3134 when inserting date field

What in the world is wrong with this simple line of code?

 dbs.Execute "INSERT INTO tempBankStatement (category, amount, date) VALUES ('Beginning Balance', " & myBegBal & ", #" & StartDate & "#);"

it keeps running "Error 3134 syntax error in INSERT INTO STATEMENT"

i've been fooling around with this for an hour!  it runs the error even if i insert a test date.

(eg.
dbs.Execute "INSERT INTO tempBankStatement (category, amount, date) VALUES ('Beginning Balance', " & myBegBal & ", #7/1/2000#);"

i've changed the format of the date, used chr(35) etc.

the statement works fine if i remove the date information.

help!
Avatar of vbDoc
vbDoc

Try replacing the # with a single quote '. ('7/1/2000')
regards,
have you tried renaming your "date" column to something other than the keyword date?

ie)
INSERT INTO tempBankStatement (category, amount, myDate <--)

ASKER CERTIFIED SOLUTION
Avatar of raizon
raizon

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of laurap

ASKER

thanks for everyone's help..........