Access - Delete Dates Cells Formatted as Short Text

exp vg
exp vg used Ask the Experts™
on
I have a [Date] field that is Short Text that was derived with the formula:

Format([YourDatefield],"m/yyyy")

From an original field [Dt].

I now need to remove from the [Date] field any dates prior to 1/2015, but am unable to successfully do this with < 1/2015 as the criteria.

Please advise.

Thank you.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016
Commented:
are deleting the records with date < 1/2015 or you want to clear the field with values < 1/2015

btw, did you try   < "1/2015"

also try

where format([date],"yyyymm") < "201501"

Author

Commented:
Since the format of the date field I created was m/yyyy

I tried this

Where Format([Date],"m/yyyy") < "1/2015"

And got an error on syntax.
Top Expert 2016

Commented:
try the other format i posted above


where format([date],"yyyymm") < "201501"
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
I want to delete the fields less than < 1/2015

Thank you.

Author

Commented:
Forgot to mention - I tried the first one first - and received the same syntax error. I then tried the one I created to see if that would work.

Both did not.
Top Expert 2016

Commented:
you can NOT delete a field only with criteria, you will be deleting the RECORD.

you can DELETE the values of a field. By setting the value to NULL or a empty string ""

what you posted is not the same as i have posted. Look carefully

Author

Commented:
Let me clarify - delete the record where this date criteria is met.

I tried the one you posted as well.

Both did not work.

This is what I tried from you:

where format([date],"yyyymm") < "201501"
Top Expert 2016

Commented:
upload a copy of the db.

Author

Commented:
Unfortunately I cannot - this is sensitive data.

I actually just thought of this, I back tracked, and as mentioned in my question post, the 1/2015 was created from an original [Dt] field - which is in Date format.

I tried

< 1/1/2015, since the records will be the same for the calculated [Date] field that is in Short Text format. However, the records with dates less than 1/1/2015 are still not deleted.

Hope this makes sense.

Author

Commented:
Got it to work by deleting from the source date file that the new date field was formatted off of.

I do thank you for your suggestions.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial