Query for Date Range

A

ArmySGT

Thank you for your help ahead of time!

I am wanting to return fields in my report that are within 30, 60, and 90
days of their Loss date calculated by todays date.

Medium Date format

Data fields look like this:

Loss Date
15-Aug-08

So when I click run query, I want to have data returned that are within 30
days of the Loss Date. I will do 3 seperate quesries, one for each
respectively.

I understand Access fairly well, but do not understand coding or formulas
besides basic excel type formulas.

Thank you again,
V/R
 
F

fredg

Thank you for your help ahead of time!

I am wanting to return fields in my report that are within 30, 60, and 90
days of their Loss date calculated by todays date.

Medium Date format

Data fields look like this:

Loss Date
15-Aug-08

So when I click run query, I want to have data returned that are within 30
days of the Loss Date. I will do 3 seperate quesries, one for each
respectively.

I understand Access fairly well, but do not understand coding or formulas
besides basic excel type formulas.

Thank you again,
V/R

The Format of the date is irrelevant for this, as long as the field's
datatype is DateTime.

As criteria on the [LossDate] Field:

Between Date() and date()-30

Between Date() and Date()-60

etc.
or you could use:
Between Date() and DateAdd("d",-30,Date())
etc.
 
J

Jerry Whittle

If this is for a report, you could use the report's sorting and grouping
options. You could sort on your date field and set Group Header to Yes. Group
On to Day with a Group Interval of 90. If the business rule is actually
Quarter, you can Group On Quarter also.
 
A

ArmySGT via AccessMonster.com

Thank you both for your replies.

I ended up using this:

Between Date() and date()+30

The + instead of the - was giving me the information I was needing. I pasted
it in the criteria box under Loss Date.

I don't know what all the () and stuff means but thanks again, I think I got
the data I needed.

Also, thanks for the report information, I have not done that yet but I may
just do that as well.

SGT Smith
 

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