Date criteria in a query

S

Skylight Steve

What criteria can I use to limit a query to a date I enter minus 14 days?
What I'm trying to do is pull entries from 2 weeks prior to a date I enter.
I tried

Between [enter end date] and -14

I assume it's the -14 that's incorrect.

Thanks in advance
 
R

Rob Parker

Between [enter end date] And DateAdd("d",-14,[enter end date])

Note that this will give a period containing 15 days. If you only want 14
days, change the -14 to -13.

HTH,

Rob
 
S

S.Clark

Between [enter end date] and [enter end date]-14

It will not prompt you twice, barring misspelling the parameter. Use Tools /
Parameters to explicitly specify that the parameter is a date.
 
S

Skylight Steve

Thanks that's a big help

Rob Parker said:
Between [enter end date] And DateAdd("d",-14,[enter end date])

Note that this will give a period containing 15 days. If you only want 14
days, change the -14 to -13.

HTH,

Rob

Skylight said:
What criteria can I use to limit a query to a date I enter minus 14
days? What I'm trying to do is pull entries from 2 weeks prior to a
date I enter. I tried

Between [enter end date] and -14

I assume it's the -14 that's incorrect.

Thanks in advance
 

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