delete lines that are from a certain date

neveu

Board Regular
Joined
Jan 27, 2009
Messages
225
hello,

i have a database containing several columns and a date column,

i would like to delete all records for which the date column equals a certain date: for example 12/21/2007.

the format of the date column is date/time

i have written the SQL code like this but it doesn't work [it says it will append 0 zeroes when it should delete 3] ; if i add the apostrophes to the data in the criteria it gives the error 'data type mismatch'

Code:
delete from tbl_up where PmntDate=12/21/2007

any ideas what is the problem?
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
If your date is actally in date format, try this:
Code:
DELETE FROM tbl_up WHERE PmntDate=#12/21/2007#
 
Upvote 0

Forum statistics

Threads
1,224,531
Messages
6,179,379
Members
452,907
Latest member
Roland Deschain

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top