SQL : Delete a record with P.K (Date Type)

Hi,

  I am trying to delete a record which has a Primary Key of Date type .

 My code => Delete * FROM Auction Where EndDate = '1/1/98'

 From the database (Access) the EndDate value is '1/1/98'

 this statement gives me an error : Mismatch ........ Criterial field  ......

  I am using ASP for your info .

 Thanks
pcseahAsked:
Who is Participating?
 
anthonycConnect With a Mentor Commented:
try this:

delete from auction where EndDate = dateserial(1998, 1, 1)

Anthony
0
 
TrygveCommented:
Try surrounding the date with hashes #1/1/98#
0
 
clifABBCommented:
Trygve:
You should have submitted that as an answer.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.