ASP SQL INSERT DATE Field Problem

dennisvb

Member
Joined
Nov 19, 2009
Messages
10
Programming Experience
10+
I am trying to create a simple update sql to update a record in an SQL database

What is the proper date format. I have tried everyone I can think of all are invalid.

I have tried

UPDATE TABLE SET DATE = #1/1/1999#

UPDATE TABLE SET DATE = '#1/1/1999#'

UPDATE TABLE SET DATE = 1/1/1999

UPDATE TABLE SET DATE = '1/1/1999'

I get messages llike error at # ,can't convert int to date, can't convert string to date.

How exaclty do I phrase this.

Thanks
 
SQL Server doesn't understand #. That's more of an Access thing, or used in VB for Date literals. You certainly can't omit the delimiters altogether. I would have thought that the last one would have worked. To be on the safe side, use an unambiguous format, e.g. '1-Jan-1999'.
 
Back
Top