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!

Inserting dates in SQL

Status
Not open for further replies.

sdpsc

Technical User
Feb 10, 2001
76
I'm making a message board for my website using ASP. For inserting new messages into the database, I have this SQL statement:

insert into guestbook (name,email,private,message,date) values('qwert','y','on','yweyyyy!!!','6/14/2005');

Name and email are text type, private is yes/no, message is memo and data is type date. This statement doesn't work (in Access, it says there is a syntax error), but when I remove the date stuff, it works fine. Any thoughts?
 
insert into guestbook (name,email,private,message,date) values('qwert','y','on','yweyyyy!!!',#6/14/2005#);

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks for your reply, unfortunately Access is still giving me a syntax error.
 
Sure, you use reserved word as field name ...
insert into guestbook ([name],email,private,message,[date]) values('qwert','y','on','yweyyyy!!!',#6/14/2005#);

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
There we go, thanks a bunch!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top