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

Addition of 4 fields in a querry

Status
Not open for further replies.

wwiSports

Technical User
May 14, 2002
31
US
I have a Crosstab Querry that totals the amount of each item (1, 2, 3, 4, 5, etc.) that each person ordered. 11, 12, 13, and 14 are all T-shirts and somehow I need to add all of them together, but I can not figure out the sql to do it:

TShirtTotal: Nz([11] + [12] + [13] + [14])

Does not work. I can't figure out how to add more than 2 fields together. Does anyone have any suggestions?

I need them added together in a BalanceDue Report.

Beth
 
I think that you need to put your NZ function around each individual field:
[tt]
TShirtTotal: Nz([11]) + Nz([12]) + Nz([13]) + Nz([14])
[/tt]
If you have any nulls in those fields, they will blow away your sum because 1+Null=Null, not 1+Null=1
 
Thank you! It worked. It's hard to believe that it is something as simple as that, and I can't believe that I didn't even think of it. Thank's again!

Beth
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top