How would you combine 6 source fields into 1 composite field from a MS Access 2003 query?

How would you revise the following INSERT INTO SQL statement so that the field Description is comprised of 6 fields as follows,

4 fields that were originally combined into refNo          PLUS the
2 fields that were originally combined into Description

(IIf(IsNull(a.JournalRef),' ',a.JournalRef)+','+IIf(IsNull(a.CTREF),' ',
a.CTREF)+','+IIf(IsNull(a.AgentCTREF),' ',a.AgentCTREF)+','+IIf(IsNull(a.OurREF),
' ',a.OurREF)) AS refNo

PLUS

(IIf(IsNull(a.AgentComments),' ',a.AgentComments)+','+IIf(IsNull(a.AgentReference),
' ',a.AgentReference)) AS Description

-----------------------------
INSERT INTO tblOpenItems
SELECT b.[Bank Code] AS Bank, b.[COST CNTR] AS Office, (' ') AS checkNum,
(IIf(IsNull(a.JournalRef),' ',a.JournalRef)+','+IIf(IsNull(a.CTREF),' ',
a.CTREF)+','+IIf(IsNull(a.AgentCTREF),' ',a.AgentCTREF)+','+IIf(IsNull(a.OurREF),
' ',a.OurREF)) AS refNo, Format(Format(a.ValueDate,"0000\/00\/00"),"mm\/dd\/yyyy")
AS [trans date], a.Mnem AS Type, Format(Format([a.Posting Date],"0000\/00\/00"),
"mm\/dd\/yyyy") AS [process date], (' ') AS Pending, a.Age AS AgeDays, IIf([S/L]="S",
IIf([DR/CR]="Credit","A","B"),IIf([DR/CR]="Credit","D","C")) AS T,
(IIf(IsNull(a.AgentComments),' ',a.AgentComments)+','+IIf(IsNull(a.AgentReference),
' ',a.AgentReference)) AS Description, IIf([DR/CR]="Credit",a.Amount*(-1),a.Amount)
AS Amount, (' ') AS UserID, (' ') AS AuditDate, Message AS Footnote, [b.Report Name]
AS responsibility, b.rptID AS rptID, 'Intellimatch' AS [Report Name], ('H') AS manual
FROM tblBanks AS b, OI_Intell AS a
WHERE left(a.BalancePool,3) & mid(a.BalancePool,5)=b.[GLAcct#];

zimmer9Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hnasrCommented:
Replace IIf(IsNull(    to  Nz(
Such as:
IIf(IsNull(a.JournalRef),' ',a.JournalRef)+','+IIf(IsNull(a.CTREF),' ', .....
Replace To:
Nz(a.JournalRef,' ') & Nz(a.CTREF,' ') .......

Complete and check and give feedback.
0
hnasrCommented:
use + for numeric and & for string fields
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.