If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Date Range in Crosstab query
I have a crosstab query using a date range Between #1/4/08# AND #31/3/09#
that works fine for this period. What I would like to know is if it is possible to specify the year in general terms with a parameter in order to be able to change the year rather than having to physically change the date range in the query for the next annual period of for example 1/4/09 and 31/3/10 |
#2
|
|||
|
|||
Date Range in Crosstab query
Try an expression like this in the Criteria under your date/time field:
= DateSerial([StartYear],4,1) And DateSerial([StartYear]+1,4,1) You will also need to declare this parameter as a number. Choose Parameters on the Query menu. In the dialog, enter: StartYear Integer -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Jomark" wrote in message ... I have a crosstab query using a date range Between #1/4/08# AND #31/3/09# that works fine for this period. What I would like to know is if it is possible to specify the year in general terms with a parameter in order to be able to change the year rather than having to physically change the date range in the query for the next annual period of for example 1/4/09 and 31/3/10 |
#3
|
|||
|
|||
Date Range in Crosstab query
Thanks very much. It works just as I wanted.
The help is much appreciated. "Allen Browne" wrote: Try an expression like this in the Criteria under your date/time field: = DateSerial([StartYear],4,1) And DateSerial([StartYear]+1,4,1) You will also need to declare this parameter as a number. Choose Parameters on the Query menu. In the dialog, enter: StartYear Integer -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Jomark" wrote in message ... I have a crosstab query using a date range Between #1/4/08# AND #31/3/09# that works fine for this period. What I would like to know is if it is possible to specify the year in general terms with a parameter in order to be able to change the year rather than having to physically change the date range in the query for the next annual period of for example 1/4/09 and 31/3/10 |
Thread Tools | |
Display Modes | |
|
|