John Desselle
asked on
Getting total of fields from same record
Hi everyone. I have one table where each record has about 12 'Original Debt' fields. I'm trying to show the total of all the "OrigDebt" fields for each record. I can get this simply by using the below SQL, but if only ONE OrigDebt has a value, the total column is blank. Is there any easy way around this?
Below I'm showing all this with just using two of my "OrigDebt" fields.
SELECT tblMain.ApplicationID, tblMain.strD_PresentLoanHereOrigDebt, tblMain.strD_OtherFinLoanCompOrigDebt, [strD_PresentLoanHereOrigDebt]+[strD_OtherFinLoanCompOrigDebt] AS TotalOrigDebt
FROM tblMain;
Below I'm showing all this with just using two of my "OrigDebt" fields.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You might update the fields in your Table as well, something like:
UPDATE tblMain SET strD_PresentLoanHereOrigDe bt = 0
WHERE strD_PresentLoanHereOrigDe bt Is Null
UPDATE tblMain SET strD_PresentLoanHereOrigDe
WHERE strD_PresentLoanHereOrigDe
ASKER
Adding the default value of "0" will be the easiest way around this. I knew it was something simple I was missing. Thanks
You're welcome.
You could use something like this...
---
SELECT
tblMain.ApplicationID,
tblMain.strD_PresentLoanHe
tblMain.strD_OtherFinLoanC
IIF(IsNull([strD_PresentLo
FROM tblMain;
---
BFN,
fp.