Update Query with date criteria

S

souchie40

Can someone please help?

I've modified a update query to only update from a specified date in the
criteria field, this is run along with a delete and append queries, this is
to import data from one DB to Another, however if I remove the criteria this
works fine, but as soon as as I put a criteria in the underlying query I get
a Error 3061 message, can one of you good people please help me out coz this
is driving me nuts.

MTIA
 
A

Allen Browne

You have a name in the query (in the Criteria row?) that Access cannot
resolve.

If you run the query manually, it will ask for a parameter. To execute the
query in code you would have to supply the parameter value before you
attempt the execute.
 
S

souchie40

Oh ok any ideas on how to do that? this is to limit the update query to
recent changes and not all records.
 
A

Allen Browne

If you wanted the changes in the last 30 days, you could put this into the
Criteria row of your query under the date field:
 
S

souchie40

That works great but assuming I wanted to go back say 6 months or so would
changing the 30 to 180 have the right sort of effect?
 
S

souchie40

This works if I add a minus sign to the 30 otherwise itwas looking at the
next month MTIA
 
Top