miuranga dilshan miuranga dilshan - 1 year ago 63
SQL Question

How to delete mdb date type data in C#

I'm writing a program employees check IN/OUT simple system. But I can delete other type data except

Date
type.

How can I delete it?

Here is a sample of my code:

DELETE FROM [INOUT]
WHERE [TIMEDATE] = '4/4/2016 12:12:12 PM';

Answer Source

Surround your date with # and not ', and format() your date as MM/DD/YYYY hh:mm:ss which is Access standard

DELETE FROM [INOUT] 
WHERE [TIMEDATE] = #04/04/2016 12:12:12#