troubleshooting Question

Multiple Concats

Avatar of jmac001
jmac001 asked on
Microsoft AccessSQL
8 Comments1 Solution197 ViewsLast Modified:
Is it possible to have multiple concatentations in SQL.  I have the following code that concats the CATEGORY in the temp table however I also need to see the CATEGORY in the primary table.

SELECT tmpQuery2.DivisionName, tmpQuery2.ProjectName, tmpQuery2.Type, 
tmpQuery2.tmpShipping.StoreNumber, tmpQuery2.tmpShipping.Shipment, 
Dconcat("tmpShipping.Category","tmpQuery2","[tmpShipping].[Shipment] = '" & 
[tmpShipping].[Shipment] & "' And [tmpShipping].[StoreNumber] = " & 
[tmpShipping].[StoreNumber]) AS Category, tmpQuery2.tmpShipping.Mode, 
tmpQuery2.tmpShipping.ActSailDate, tmpQuery2.tmpShipping.EstArrivalDate, 
tmpQuery2.tmpShipping.ActArrivalDate, tmpQuery2.tmpShipping.Signature, 
tmpQuery2.Shipping.StoreNumber, tmpQuery2.Shipping.Shipment, 
tmpQuery2.Shipping.Mode, tmpQuery2.Shipping.ActSailDate, 
tmpQuery2.Shipping.EstArrivalDate, tmpQuery2.Shipping.ActArrivalDate, 
tmpQuery2.QtyReceived, tmpQuery2.Shipping.Signature

FROM tmpQuery2

GROUP BY tmpQuery2.DivisionName, tmpQuery2.ProjectName, tmpQuery2.Type, 
tmpQuery2.tmpShipping.StoreNumber, tmpQuery2.tmpShipping.Shipment, 
Dconcat("tmpShipping.Category","tmpQuery2","[tmpShipping].[Shipment] = '" & 
[tmpShipping].[Shipment] & "' And [tmpShipping].[StoreNumber] = " & [tmpShipping].[StoreNumber]), 
tmpQuery2.tmpShipping.Mode, tmpQuery2.tmpShipping.ActSailDate, 
tmpQuery2.tmpShipping.EstArrivalDate, tmpQuery2.tmpShipping.ActArrivalDate, 
tmpQuery2.tmpShipping.Signature, tmpQuery2.Shipping.StoreNumber, 
tmpQuery2.Shipping.Shipment, tmpQuery2.Shipping.Mode, tmpQuery2.Shipping.ActSailDate, 
tmpQuery2.Shipping.EstArrivalDate, tmpQuery2.Shipping.ActArrivalDate, 
tmpQuery2.QtyReceived, tmpQuery2.Shipping.Signature

ORDER BY tmpQuery2.DivisionName, tmpQuery2.Type, 
tmpQuery2.tmpShipping.StoreNumber, tmpQuery2.tmpShipping.Shipment;


If I just add the field to the PRIMARY table it displays, however the TEMP CATEGORY data is gone.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 8 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros