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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting last4weeks data

Status
Not open for further replies.

reacha

Programmer
Jun 9, 2010
83
US
I have a report which is grouped by username first

and after that grouped by auditstamp for each week.

now what i need to write in the record selection to get last4weeks data

Please help me out!!



Thanks,
reacha
 
Hi,
Is the auditstamp field a DATE field?

If so then a selection formula something like

auditstamp In DateAdd(w,-4,auditstamp) to CurrentDate

should get that range

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
yes it is a datefield...

but this didn't worked and i tried something like Last4WeeksToSun


Thanks,
reacha
 
Try
Auditstamp in DateAdd("ww", -4, currentdate) to currentdate

Four weeks prior from today's date.
 
Hi,
Good catch VKZIMM!

I should have looked at my logic more closely.





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
i am getting different values if i use

Auditstamp = Last4WeeksToSun
and
Auditstamp in DateAdd("ww", -4, currentdate) to currentdate

what is the difference in these two and some times i am getting more than 4 weeks if i use any one of those.
I need to get exactly Last 4 weeks

Thanks,
reacha
 
Hi,
Last4WeekstoSun can be different from 4 weeks before CurrentDate if CurrentDate is not Sunday.

Try:

AuditStamp >= (CurrentDate - 28 )



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top