dateadd question

A

Anna Tolstoj

Hi,

I'm importing data into Access from an external database. Unfortunately
some of my date data comes across incorrect and I need to update it. For
instance I will have dates listed as 01/01/1900 instead of 01/01/2000,
01/01/1901 instead of 01/01/2001 and so forth.

I thought I could use the following in an update query:

DateAdd("yyyy",100,"invoice_date")

but I'm getting a "Data type mismatch in criteria expression" error when I
try to run the query.

Any suggestions on what I could be doing wrong?

Thanks,

Anna
 
J

John Spencer (MVP)

Your third parameter should NOT be a string.

Set [invoice_date] = DateAdd("yyyy",100,[invoice_date])
 
A

Anna Tolstoj

oh my, sometimes I wonder how I even get out of bed in the morning...

Thanks for straightening me out so quickly.

:)


John Spencer (MVP) said:
Your third parameter should NOT be a string.

Set [invoice_date] = DateAdd("yyyy",100,[invoice_date])

Anna said:
Hi,

I'm importing data into Access from an external database. Unfortunately
some of my date data comes across incorrect and I need to update it. For
instance I will have dates listed as 01/01/1900 instead of 01/01/2000,
01/01/1901 instead of 01/01/2001 and so forth.

I thought I could use the following in an update query:

DateAdd("yyyy",100,"invoice_date")

but I'm getting a "Data type mismatch in criteria expression" error when I
try to run the query.

Any suggestions on what I could be doing wrong?

Thanks,

Anna
 

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

Top