R
RFrechette
I am trying to create a query that retrieves the records from the last 3
periods entered into the system.
I am gathering my data from a SQL database where I can not change the
formats of any of the fields.
Each record is entered with a Period Date called "read_period". (For
example, 200608, 200609, 200610, etc) These are actually text fields. They
are not necessarily just the month's data, 200609 could have data from
09/02/06 thru 10/05/06, so I can't just go by month.
I need to create a query (for a report) that will automatically give me data
for the last three periods entered in the system.
So if the last period entered was 200610, I would need 200608, 200609, and
200610. If the last period entered was 200611, I would need 200609, 200610,
and 200611.
I know I can easily do this by putting a criteria of Between [Enter Beg
Date] and [Enter End Date] for the user to specify the periods (that worked
for me). However, management would like the report to just grab the last
three periods automatically without any user input.
Is this possible and if so, could someone explain how I can accomplish this?
I would greatly appreciate it.
Thanks,
Rachel
periods entered into the system.
I am gathering my data from a SQL database where I can not change the
formats of any of the fields.
Each record is entered with a Period Date called "read_period". (For
example, 200608, 200609, 200610, etc) These are actually text fields. They
are not necessarily just the month's data, 200609 could have data from
09/02/06 thru 10/05/06, so I can't just go by month.
I need to create a query (for a report) that will automatically give me data
for the last three periods entered in the system.
So if the last period entered was 200610, I would need 200608, 200609, and
200610. If the last period entered was 200611, I would need 200609, 200610,
and 200611.
I know I can easily do this by putting a criteria of Between [Enter Beg
Date] and [Enter End Date] for the user to specify the periods (that worked
for me). However, management would like the report to just grab the last
three periods automatically without any user input.
Is this possible and if so, could someone explain how I can accomplish this?
I would greatly appreciate it.
Thanks,
Rachel