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

Help with inserting date field into database!!! 4

Status
Not open for further replies.

JoJoH

Programmer
Jan 29, 2003
356
US
Hi,

Could anyone please help me with this? I am trying to insert a date value into my database.

In my code there is a line that requests the date:

Request("payment_date")

And I am trying to insert that value into my database, the code is something like this:

strSQL="INSERT INTO Sold (SoldDate) VALUES ( #" & payment_date & "#)"

But I kept getting errors.

I have tried to switch the #" & payment_date & "# to

#' & payment_date & '#

"# & payment_date #"

'" & payment_date "'

'# & payment_date #'

'"# & payment_date #"'

But they all don't work, either I get a datatype mismatch error or expected end error.

I am pretty sure the error is at #" & payment_date & "#, but just don't know how to fix it. Please advice.

Thanks in advance.


 
Thank you all for all the help!! It is finally working! palbano, shaddow, MrGreed, Mun, all of you, thankyou once again!!

Just in case someone might be viewing this thread for help in the future, just look at palbano's answer to make a long story short, all the other posts above did a wonderful job to help me clear the mud, than finally when I am starting to see what it is all about, palbano's F&Q tells me how to do it. So if you are like me, kind of lost than read the whole thread. Otherwise just look at palbano's F&Q. FAQ333-3048, reference 8.

 
Ok 1 thing i dont get it?
Did you used ASP or Acces querry?
________
George, M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top