Solved

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

Posted on 1998-06-11
3
124 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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Write data from SQL to CSV file - position 1 61
VBA color chart bars 12 86
message box in access 4 47
VBA - Excel, Hide/unhide range of rows on sheet with listbox selection 9 48
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

832 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