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

Date Range Record Selection 4

Status
Not open for further replies.

NattyCat

MIS
Aug 9, 2004
38
GB
Crystal V9, SQL Server 7.


I think my brain is leaking, as I simply cannot get it to function and create (what I think is) a simple formula.

Can anyone give me a quick solution while I see if some caffiene kicks my grey matter into gear?

I have a report that is scheduled to run on the 23rd of each month. The report needs to be limited to only show data from the 21st of the previous month to the 22nd of the current month - without parameters.


Help?
 
If you can be sure of it being the 23rd, then From could be (DateAdd("m", -1, currentdate)-2 and To ould be currentdate-1

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
{mytable.mydate} in DateTime (year(currentdate), month(currentdate)-1, 21, 00, 00, 00) to DateTime (year(currentdate), month(currentDate), 22, 00, 00, 00)

You might need to amend the time elements depending on the exact range that you want to include
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top