Brain Cramp!

J

JR

In a query I have to sum shipping weights for different
items.

customer | Item_1 | Item_2 |Item_n | Total_1-n |

How can I get this done?

Thanks!
 
D

Duane Hookom

I don't see anything that suggests you are storing shipping weights.
Considering what you have provided, your request is impossible.
 
G

Guest

customer | Item_1 | Item_2 |Item_n | Total_1-n |

Item_1, etc are the weights for the items
 
J

John Spencer (MVP)

Another problem is if any of the Item_n fields are null. Then you have to use
the Nz function or an IIF to return zero vice null

Total_Wt: Nz(Item_1,0) + Nz(Item_2,0) + Nz(Item_3,0) + ... + Nz(Item_n,0)

Or instead of the Nz
IIF(Item_1 is Null,0,Item_1) + ...
 
D

Duane Hookom

In addition to Steve's comments, you may need to use
Nz(Item_1,0)+Nz(Item_2,0)+... if any of the "weights" might be null.

Normalization would cure this ill.
 
Top