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

Sum with variable in Report

Status
Not open for further replies.

traycee

IS-IT--Management
Sep 6, 2001
245
US
Hi All!

In the footer section of a report, I am using the following formula:

=Sum(Abs([ServiceCode]="003" Or [ServiceCode]="004" And ([Hours]>=0.5)))

in a text box to get a count of just 003 and 004 codes that have hours greater than or equal to .50 (which is 1/2 hour). [Hours] come from the difference between the start time and the end time and is calculated within the query.

It does count only the 003 and 004 codes just fine, the problem is it ignores the [Hours]>=.5. I want it to only count 003 and 004 if the hours for that client with that code is greater than 1/2 hour. Any clue as to why that isn't happening with the formula listed above?

Thanks!
 
Figured it out myself. Changed formula to

=Sum(Abs([ServiceCode]="002" And [Hours]>=0.5 Or [ServiceCode]="004" And [Hours]>=0.5))

And it worked. Don't know why it didn't work the other way...but oh well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top