Query - 30 days prior to a specific date

cptlrg

New member
Local time
Today, 09:41
Joined
Jul 14, 2018
Messages
6
Hi everyone,

I am struggling with something I thought would be easy to do.:confused:

I need a query to only count records of sales that took place 30 days prior to a specific date entered onto a form. The date field is SrtDte. I have been able to get the query to pick up sales within 30 days prior to todays date, but need to use the the SrtDte criteria not todays date.

Can anyone help with this?

Thanks,
Stuart
 
the same principle applies, use [Forms]![yourForm]![SrtDate] rather than Date():

Where [dateField] = [Forms]![yourForm]![SrtDate] - 30


on Query design:

Field: dateField
Table: yourTableName
Sort:
Show: (checked)
Criteria: [Forms]![yourForm]![SrtDate] - 30
 
Hi, thanks for the reply,

This is what I have tried, however it does not appear to be working.

From what I can see, it is not picking up the sales taken during the 30 days prior to the start date, but it is counting the sales prior to the date calculated with the 30 days.

For example if a sale was made 15 days ago it is not counting this. It is however counting a sale that occurred 33 days ago.

I am unsure why this is happening :confused:
 
I have managed to work it out!

Between [Forms]![Menu]![StrDte] And [Forms]![Menu]![StrDte]-30

Thanks for your help
 
Last edited:
Post up the SQL of your Query ? Use the # code tags if it is a long string.
 

Users who are viewing this thread

Back
Top Bottom