Add two columns....

konquistador

Registered User.
Local time
Today, 03:52
Joined
Oct 23, 2007
Messages
16
Hi All,
I have a Append query which has columns from two tables. Now i need to create a new column "Sum" in new table which should Add two of the Number columns .
That is : I have column A and Column B; I need to create a Column C which contains (A+B)
Please advise.

Thanks,
Kon
 
You don't need to store this value. Simply use a query or calculate it in your form or report.
 
Hi, that is exactly what i want, Please suggest how to achieve this using a Query. ?

Thanks,
Kon
 
I mean, Do i need to modify SQL in SQL mode or can i do it in Design Mode of a Query?
Please help!

Thanks,
Kon
 
Just add a calculated field in the query design grid. In the first empty column, in the field name cell just put
FieldC: [FieldA]+[FieldB]

If there's any chance that A or B could be null, change this to
FieldC: Nz([FieldA]) + Nz([FieldB])
 
I had struggled so much trying to get that to work, thank you so much...what does the NZ do? or what does it stand for?
 
I had struggled so much trying to get that to work, thank you so much...what does the NZ do? or what does it stand for?
NZ stands for Null to Zero and it can actually make nulls any value you want but you encapsulate something that might return a null and then the default is for it to return a zero if a numeric or an empty string "" if text.

But you can have it return anything you want for null.

For example if I have a field that returns null I may want it to return 99999 instead so I can use:

NewFieldNameHere: Nz([FieldNameHere],99999)

And if FieldNameHere was null it would return 99999 instead of Null for that field.
 

Users who are viewing this thread

Back
Top Bottom