SQL

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using this SQL code to combine name and address etc together in groups,
what can I add to allow spacing between names? currently they are seperated
by a comma.

SELECT Conc("Field2","Node4_ID",[Node4_ID],"OCR") AS Field2,
OCR.Node4_Number, OCR.Node4_ID, OCR.[OPR or OCR]
FROM OCR
GROUP BY OCR.Node4_Number, OCR.Node4_ID, OCR.[OPR or OCR];
 
What is "Conc"? A function that you created? I can't find it as a keyword. If
it is you own function, you'll have to explain what it does.
 
conc is concordance, it is used because I have multiple ID's that have the
same OCR and needed to combine them together so I could input them in a
document. the problem is they are not spaced because of the concordance.
Either I need to change the whole code or add a phrase to make spacing.

Instead of:
Smith, Jones, peterson
I need:
Smith
Jones
Peterson

Jerry Whittle said:
What is "Conc"? A function that you created? I can't find it as a keyword. If
it is you own function, you'll have to explain what it does.
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


CZ said:
I am using this SQL code to combine name and address etc together in groups,
what can I add to allow spacing between names? currently they are seperated
by a comma.

SELECT Conc("Field2","Node4_ID",[Node4_ID],"OCR") AS Field2,
OCR.Node4_Number, OCR.Node4_ID, OCR.[OPR or OCR]
FROM OCR
GROUP BY OCR.Node4_Number, OCR.Node4_ID, OCR.[OPR or OCR];
 
There is a generic concatenate function at
http://www.rogersaccesslibrary.com/OtherLibraries.asp#Hookom,Duane with a
sample of how to place a CrLf between values.

--
Duane Hookom
MS Access MVP

CZ said:
conc is concordance, it is used because I have multiple ID's that have the
same OCR and needed to combine them together so I could input them in a
document. the problem is they are not spaced because of the concordance.
Either I need to change the whole code or add a phrase to make spacing.

Instead of:
Smith, Jones, peterson
I need:
Smith
Jones
Peterson

Jerry Whittle said:
What is "Conc"? A function that you created? I can't find it as a
keyword. If
it is you own function, you'll have to explain what it does.
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


CZ said:
I am using this SQL code to combine name and address etc together in
groups,
what can I add to allow spacing between names? currently they are
seperated
by a comma.

SELECT Conc("Field2","Node4_ID",[Node4_ID],"OCR") AS Field2,
OCR.Node4_Number, OCR.Node4_ID, OCR.[OPR or OCR]
FROM OCR
GROUP BY OCR.Node4_Number, OCR.Node4_ID, OCR.[OPR or OCR];
 
This should help me, thanks

Duane Hookom said:
There is a generic concatenate function at
http://www.rogersaccesslibrary.com/OtherLibraries.asp#Hookom,Duane with a
sample of how to place a CrLf between values.

--
Duane Hookom
MS Access MVP

CZ said:
conc is concordance, it is used because I have multiple ID's that have the
same OCR and needed to combine them together so I could input them in a
document. the problem is they are not spaced because of the concordance.
Either I need to change the whole code or add a phrase to make spacing.

Instead of:
Smith, Jones, peterson
I need:
Smith
Jones
Peterson

Jerry Whittle said:
What is "Conc"? A function that you created? I can't find it as a
keyword. If
it is you own function, you'll have to explain what it does.
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


:

I am using this SQL code to combine name and address etc together in
groups,
what can I add to allow spacing between names? currently they are
seperated
by a comma.

SELECT Conc("Field2","Node4_ID",[Node4_ID],"OCR") AS Field2,
OCR.Node4_Number, OCR.Node4_ID, OCR.[OPR or OCR]
FROM OCR
GROUP BY OCR.Node4_Number, OCR.Node4_ID, OCR.[OPR or OCR];
 
Back
Top