Solved

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

Posted on 1998-06-11
3
126 Views
Last Modified: 2010-05-03
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
0
Comment
Question by:pcseah
3 Comments
 
LVL 12

Expert Comment

by:Trygve
ID: 1463076
Try surrounding the date with hashes #1/1/98#
0
 
LVL 6

Expert Comment

by:clifABB
ID: 1463077
Trygve:
You should have submitted that as an answer.
0
 
LVL 6

Accepted Solution

by:
anthonyc earned 20 total points
ID: 1463078
try this:

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

Anthony
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question