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

Select two next full weeks

Status
Not open for further replies.

acessn

Programmer
Feb 16, 2005
71
NO
Hi.

Using CR 9.0, Microsoft sql server, reporting from within Kronos.

Record selection as of now:
{dbtable.applydate} in {from timeframe} to {to timeframe}
Here I select the dates from within the Kronos system. I need to run this automatically, so it's not an acceptable solution.


What I need is to force the dates to be within the next two full weeks.Say, if I was to run the report today(14.04.05), the actual dates should be "from timeframe: mon 18.04.05" and "to timeframe: Sun 01.05.05".

Any ideas?

Best regards, Bjorn
 
There may be a slicker way but this has done the job for me previously:
Code:
(
    if dayofweek(currentdate)=1 //Run on Sunday 
        then {@Date} in currentdate to currentdate+14
    else if dayofweek(currentdate)=2 //Run on Monday 
        then {@Date} in currentdate+6 to currentdate+19
    else if dayofweek(currentdate)=3 //Run on Tuesday 
        then {@Date} in currentdate+5 to currentdate+18 //run from the following Sunday for two full weeks

//        add to formula to cover other days of week        )

This is to be insterted into the Record Selection Formula. Where I refer to {@Date} above just insert your own datefield.

Hope this helps.
ShortyA
 
Thanks!

This did the trick!

Best regards, Bjorn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top