Date Range Expression Problem

G

Guest

I'm desigining a macro so that it will open and print the same report
multiple times. Basically, I want each report to return data with different
date ranges. I'm running into a problem with the "Where Condition" under the
OpenReport Macro Action. The Where Condition I have is:

First Report (showing results of releases between now and the next 12 months)
([qryNewReleases]![Release Date]) = Between Date() And DateAdd("m",12,Date())

Second Report (showing results of releases between now and the next 6 months)
([qryNewReleases]![Release Date]) = Between Date() And DateAdd("m",6,Date())

I keep getting errors that the expressions aren't correct. Could anyone
lend a hand and let me know what I'm doing wrong with the expression?
 
K

Ken Snell [MVP]

Change this expression
([qryNewReleases]![Release Date]) = Between Date() And
DateAdd("m",12,Date())

to this
([qryNewReleases]![Release Date]) Between Date() And
DateAdd("m",12,Date())

Modifying the other expression is an exercise left to the reader for
edification. < g >
 
G

Guest

Ken,

Thanks for the help. I modified the expression and it works perfectly.

- Mkauley

Ken Snell said:
Change this expression
([qryNewReleases]![Release Date]) = Between Date() And
DateAdd("m",12,Date())

to this
([qryNewReleases]![Release Date]) Between Date() And
DateAdd("m",12,Date())

Modifying the other expression is an exercise left to the reader for
edification. < g >

--

Ken Snell
<MS ACCESS MVP>

Mkauley said:
I'm desigining a macro so that it will open and print the same report
multiple times. Basically, I want each report to return data with
different
date ranges. I'm running into a problem with the "Where Condition" under
the
OpenReport Macro Action. The Where Condition I have is:

First Report (showing results of releases between now and the next 12
months)
([qryNewReleases]![Release Date]) = Between Date() And
DateAdd("m",12,Date())

Second Report (showing results of releases between now and the next 6
months)
([qryNewReleases]![Release Date]) = Between Date() And
DateAdd("m",6,Date())

I keep getting errors that the expressions aren't correct. Could anyone
lend a hand and let me know what I'm doing wrong with the expression?
 
K

Ken Snell [MVP]

You're welcome.

--

Ken Snell
<MS ACCESS MVP>

Mkauley said:
Ken,

Thanks for the help. I modified the expression and it works perfectly.

- Mkauley

Ken Snell said:
Change this expression
([qryNewReleases]![Release Date]) = Between Date() And
DateAdd("m",12,Date())

to this
([qryNewReleases]![Release Date]) Between Date() And
DateAdd("m",12,Date())

Modifying the other expression is an exercise left to the reader for
edification. < g >

--

Ken Snell
<MS ACCESS MVP>

Mkauley said:
I'm desigining a macro so that it will open and print the same report
multiple times. Basically, I want each report to return data with
different
date ranges. I'm running into a problem with the "Where Condition"
under
the
OpenReport Macro Action. The Where Condition I have is:

First Report (showing results of releases between now and the next 12
months)
([qryNewReleases]![Release Date]) = Between Date() And
DateAdd("m",12,Date())

Second Report (showing results of releases between now and the next 6
months)
([qryNewReleases]![Release Date]) = Between Date() And
DateAdd("m",6,Date())

I keep getting errors that the expressions aren't correct. Could
anyone
lend a hand and let me know what I'm doing wrong with the expression?
 

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