Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using DateAdd in CrossTab query vs parameter

Status
Not open for further replies.

4656rp

Technical User
Feb 25, 2003
20
US
Another date question, sorry. I discovered that I can't use a parameter query in a crosstab query. I wanted the user to specify a date range between [start date] and [end date]; that didn't work. Next, I figured using a moving date range, but I want to exclude the current month. So I tried >DateAdd("m",-12,Date()), and here my result ranges from 1/04-1/05. Not what I wanted, but I'd settle for that except, that when I went to validate the results using between 1/1/04 and 12/31/04 the results for 1/04 (only) were wrong. When the query is run next month, I want to see 02/04-01/05. It may be obvious, but after flipping through 50+ pages on this site I'm %-).

Many thanks
 
I discovered that I can't use a parameter query in a crosstab query
Really ?
You simply have to defines the parameters in the crosstab query too.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
:~/ Tremendously! Many, many, many thanks, you've bailed me out again.

So what was wrong with DateAdd......?
 
And what about this ?
Between DateSerial(Year(Now)-1,Month(Now)-1,1) And DateSerial(Year(Now),Month(Now),0)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top