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!

Date Range for past dates as well as future dates

Status
Not open for further replies.

landview

Programmer
Mar 19, 2013
4
0
0
US
WorkedDate is the field which stores dates upto current date agaginst Employee Time Sheet.
1- If start-date and end-date parameters are both past dates then my report will show Total Hours each employee worked in that date range and what is the (Total working days x 8)=TotalWorkingHours in that date range.(this case is working)
2- If the Start-date is the past date and end date is the future date then Report will show Total Hours each employee worked in that date range and TotalWorkingHours in that date range.(this case is working)
3-If start-date and end-date both are future dates, then the report will calculate only TotalWorkingHours in that date range.(here my record selection formula doesn't work.
My Record Selection Formula is: (CDATE({Command.WorkedDate})>={?start-date} and CDATE({Command.WorkedDate})<={?end-date})
and {Command.DeptId}={?DeptId}
and {Command.ProjId}={?ProjId}
and {Command.Name}={?Employee Name}
So, how to modify this logic so that CDATE({Command.WorkedDate})>={?start-date} or CDATE({Command.WorkedDate})<={?start-date}
Please, advice me.
Thank you.
 
use and If ..then..else wrapped in ()

Something like

(If {?start-date} > currentdate then
.. your future date conditions else
.. your other date conditions)
and {Command.DeptId}={?DeptId}
and {Command.ProjId}={?ProjId}
and {Command.Name}={?Employee Name}

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top