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!

help with a control in a report

Status
Not open for further replies.

chiefvj

Technical User
Feb 4, 2005
73
US
I am trying to get this query placed in a control running on a report to execute correctly. ..

=[CompForOffday]-Abs(Sum([chvSelector]="Comp for Off Day") & abs(sum(apprv))

CompforOffday = 5.

This is how the table looks..
chvSelector Apprv
-------------------------------------
comp for off days 1
vacation -1
vacation 1
comp for off days -1
--------------------------------------
I have 4 records in a table. I want to sum only the record that have a value "Comp for off day" and are approved.

thx in advance..
 
What is your expected result? You are treating Appr like a yes/no field and yet you are displaying values of 1 or -1 when they should be -1 or 0.
What are you summing?

Duane
Hook'D on Access
MS Access MVP
 
Apprv is yes/no.. The answer I should get running that query is 4. The constant "compforOffday" minus 1 chvSelector that is a "comp for off day"..My query results in 0 records countered.
 
how about
=[CompForOffday]-dsum("apprv",tablename,"chvSelector='Comp for Off Day'")
 
I expect you want to total in a group header or footer. The expression might be:
Code:
=[CompForOffDay] - Sum(Abs([chvSelector] = "Comp For Off Days" AND [Apprv]))

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top