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

This date issue again

Status
Not open for further replies.
Jul 28, 2011
167
NG
Hi all, I just resumed work again after a short leave and was welcomed with a new report.

Here's it:
Users should be able to select a range of date (which I've already implemented and works fine).
Now, the issue is:
We dont work on Weekends and also the last friday of the month is the last company month. I've been trying to exclude this days from the selection, but its giving me heart-aches.

Currently I have a date parameter {?Date} with default value 1/1/1753 00:00:00 and description "All" which is set to choose range values.
In my selection criteria, I did:
(
if {?Date} = datetime('1753/01/01 00:00:00') then
{useWipByAgeReport.Last Posting Date} in datetime('1753/01/01 00:00:00') to datetime('2999/12/31 12:59:59')
else
{useWipByAgeReport.Last Posting Date} in {?Date}
)

...
Then I went blank. :(

____________________
Men put up a strong face just to cover their weaknesses...good!
But a smile makes them live longer....
Which would you choose?

Think about it.
 
infinitizon,

I suppose it depends the end result needed.

Record Selection:
You can exclude Saturdays & Sunday's with the DayOfWeek() function - CR Help can provide an explanation. To exclude the Friday's... and array of manually inputted dates could be the most simple approach - though it would need updated every year (or "x" often).

Number of Days in the Range:
What about a variation on Ken Hamady's "Number of working days between two dates" but with these special Friday's populated into the "Holiday's" Array. Link to Ken's Site

Hope this helps!

Mike
---------------------------------------------------------------
"To be alive is to revel in the moments, in the sunrise and the sunset, in the sudden and brief episodes of love and adventure,
in the hours of companionship. It is, most of all, to never be paralyzed by your fears of a future that no one can foretell."
 
thanks MCuthill,

It looks great; I'd try it

____________________
Men put up a strong face just to cover their weaknesses...good!
But a smile makes them live longer....
Which would you choose?

Think about it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top