?
Solved

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

Posted on 1998-06-11
3
Medium Priority
?
128 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 60 total points
ID: 1463078
try this:

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

Anthony
0

Featured Post

Industry Leaders: 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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Suggested Courses
Course of the Month14 days, 7 hours left to enroll

771 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