deleting wrong dates

E

Eduardo

Hello... i have an access 2007 database. I have a date field ([Sales-Date
Install #9]) with incorrect data in it.

I would like to update those fields to Null value.

here's the sql i'm using:

update STR_CRM_1_Contacts set
STR_CRM_1_Contacts.[Sales-Date Install #9] = Null
WHERE not isdate(STR_CRM_1_Contacts.[Sales-Date Install #9]);

unfortunately this doesn't work.

I have data in this field, like: 11/30/122 or 11/30/134...

I would like to get rid of those incorrect values.

so what's wrong with my query???

Any help will be appreciated.
Thanks
Eduardo
 
A

Allen Browne

Those are valid dates, so perhaps you want to clear the dates outside of a
particular range, e.g.:

UPDATE STR_CRM_1_Contacts
SET [Sales-Date Install #9] = Null
WHERE ([Sales-Date Install #9] < #1/1/1900#)
OR ([Sales-Date Install #9] > #1/1/2199#);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Using DateAdd and IIF conditions in a Query 2
Validate a Date 1
Default Value as last date in a table? 5
Rank a Rank? 1
Maximum of Two Dates 4
DATE/TIME MATH ISSUE!!!! 2
Data Mistype error 10
Date() help 2

Top