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!

Need to get Current Data based Upon a Date.. COMPLEX 1

Status
Not open for further replies.

rdjohnso

Programmer
Mar 30, 2001
67
US
Need to get Current Data based Upon a Date

--------------------------------------------------------------------------------

Situation.... Heres a complex one.. Any insight would be appreciated....!!

We have a report that outputs months of calculated data....(kinda like a datasheet in excel)
thus we need to have calcuated cells in a QBE pane for each field represented in the Report....

So for instance... Field one in the Report, we have to output
the Allocated hours for the current Month and the Rate...

Requirements...
- dateNow must be between PersonStartDate and PersonEndDate
if and only if so... then get...

For field One Hours:
current Allocation: currAlloc = (between AllocationStartDate and AllocationStartDate)

Hours0 = (currAlloc x 160)

AND

For field One Rate:
current Rate: currRate = (between RateStartDate and RateStartDate)

Rate0 = (Hours0 x currRate)
..............

I have put this logic together in my head.. but it becomes complex when there is another factor of the CurrentDate (or CurrentDate + x) dictating the 2 fields needed.

Please advise,

Thanks,

Ron
 
if now() > PersonStartDate AND now() < PersonEndDate THEN
currAlloc = (between AllocationStartDate AND AllocationStartDate)
Hours0 = (currAlloc x 160)
currRate = (between RateStartDate and RateStartDate)
Rate0 = (Hours0 x currRate)
endif

Ian Mayor (UK)
Program Error
There's ALWAYS more than one way to skin a cat!
But only one way to get it RIGHT!
 
Thanks ProgramError....

the logic looks correct but how do I incorporate this into the 'Criteria' field in a QBE panel (query field) for a report......
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top