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

symbols around Variables for sql statement

Status
Not open for further replies.

jasonhuibers

Programmer
Sep 12, 2005
290
CA
Classic ASP
SQL Server 2008

Which symbols do I use around each data type for my variables:
Dates
Strings
Numbers

varCreateDate = now() this gives me 1900-01-01 in the db!!!

sql_insert = "insert into CCExpenseTable (CreateDate,CreatedBy) values (" & varCreateDate & ", '" & varCreatedBy & "')"


 
strings = ' (single quote)

numbers nothing

Why not use the NOW function of SQL Server for the time stamp?

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top