Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
StringAgg Function
Ben Perry 
       
5 months ago
My failure to get results would lead me to believe Access does not support a StringAgg function the way some sources says it does without VBA. I have only scratched VBA and would prefer to do this in a query unless there is a simple VBA way of doing it. I am trying to concatenate a single field from multiple records into a new single field separated by commas. The fields I am trying to concatenate are from an aggregate query that has to values I am wanting so there is another field that combines them into multiple records. Specifically I am trying to create an ingredient label. Any help would be appreciated.
Alex Hedley  @Reply  
           
5 months ago
Do you mean like STRING_AGG (Transact-SQL)?
Alex Hedley  @Reply  
           
5 months ago
Which sources?
Ben Perry OP  @Reply  
       
5 months ago
It looks like it would be the same as example D in the link you provided. The source is a query 4th in line to widdle down to the information needed and sorted. I will try to put a sample set of data but essentially the query consists of "RetailItemName", "ItemCategory", and "SumofgWeight" sorted by weight. There are multiple identical values in RetailItemName with single returns for ItemCategory (ultimately they are ingredients). If I were making a simple report I would argue I am done and put in a group header on a report for RetailItemName and then ItemCategory would be the records. That won't work for my end result because of the use for this 'report'.
Ben Perry OP  @Reply  
       
5 months ago

Ben Perry OP  @Reply  
       
5 months ago
After finally getting chatgpt to stop procastinating (no money for paid use so stuck with the limits of free). I did manage to get what I needed. It doesn't seem like it can be done without VBA period. I will post the code and the query calling it to show what the solution was. I don't fully understand the code which is why I was hoping someone had a solution without but thought it might be helpful to put up. I'll be glad when I get more developer lessons under my belt.
Ben Perry OP  @Reply  
       
5 months ago

Ben Perry OP  @Reply  
       
5 months ago

Ben Perry OP  @Reply  
       
5 months ago
Sorry, realized much later that I should probably provide a screenshot of the result so everyone can see. Also, thank you Alex for trying to help. Also happened to do a quick search to see if this was covered anywhere between stringagg (couldn't find before but double checked tonight) and concatrelated. It doesn't look like it's been covered before, would anyone know if I overlooked something?
Ben Perry OP  @Reply  
       
5 months ago

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/6/2026 2:41:10 PM. PLT: 0s