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!

Select the previous 12 hour period 1

Status
Not open for further replies.

BobHunter

Programmer
Mar 26, 2001
62
0
0
GB
This is alledegly answered here but the site has gone...


I have a report which is scheduled to run at 7am daily and I want to grab data for the previous 12 hour period (shift patterns).

I am currently doing this manually with 2 parameter fields, StartDate & EndDate.

What a *REALLY* want is a formula to work out what date/time it is, and then run a report with details from 7am-7pm or 7pm-7am.

For example, the report is run a 7.05pm, it will grab data from previous day 7am-7pm. Conversley, if it is run at 7.05am, it will grab data from 7pm-7am the previous day.

Any takers on that one - it's driving me crazy.

Bob. (CR8)
 
Place the following in your record selection formula, changing the item in bold with your date time field :

If currenttime in Time(07,00,00) to Time(19,00,00) then
({DateTime} >= DateTime(CurrentDate-1,Time(19,00,00)) and
{DateTime}< DateTime(CurrentDate,Time(07,00,00))) else
({DateTime} >= DateTime(CurrentDate,Time(07,00,00)) and
{DateTime} < DateTime(CurrentDate,Time(19,00,00)))

Reebo
UK

&quot;Before you judge a man, walk a mile in his shoes. After that, who cares? ...He's a mile away and you've got his shoes.&quot; - Billy Connolly
 
Lost me a bit, but it looks like exactly what I'm after..

I am using 2 parameter fields currently & my formula is :

{HPD:HelpDesk.Resolved} >= {?StartDate} and {HPD:HelpDesk.Resolved} <= {?EndDate}

Should I remove these 2 parameter fields and redeclare these in the formula or something ?

Let me know & thanks in advance.....
 
Sorted it now and it works perfectly - thanks for all your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top