My Assistant
![]() ![]() |
|
|
Feb 25 2009, 09:18 AM
Post
#1
|
|
|
UtterAccess Veteran Posts: 409 From: Minnesota, USA |
I have a feeling the answer is no, but I thought I'd ask anyway.
In strict SQL (because this is actually for a pass-through query), can you concatenate subrecords instead of repeating them? E.g. if you had a table called tblOwners and a subtable called tblPets, if I have 3 pets, it might look like this: Owner.....Pet Brian.......Fido Brian.......Goldy Brian.......Silly Could you rewrite your query to show: Owner.....Pet Brian.......Fido, Goldy, Silly without resorting to VBA? Thanks! |
|
|
|
Feb 25 2009, 09:45 AM
Post
#2
|
|
|
UtterAccess VIP Posts: 17,638 From: Don Mills, ON (Canada) |
Without resorting to VBA? Not really.
If you knew the maximum possible number of subrecords, you could join the table to itself multiple times, extracting only one subrecord for each instance and concatenate that way, but it would be slow and messy. |
|
|
|
Feb 25 2009, 09:46 AM
Post
#3
|
|
|
UtterAccess Veteran Posts: 409 From: Minnesota, USA |
Thanks Doug, that's what I figured. I already have a VBA function that does this, was hoping to speed it up a touch, but it'll have to do.
|
|
|
|
Feb 25 2009, 10:01 AM
Post
#4
|
|
|
UtterAccess Guru Posts: 726 From: Maine, US |
Try a cross tab query.
|
|
|
|
Feb 25 2009, 10:38 AM
Post
#5
|
|
|
UA Editor + Utterly Certified Posts: 22,722 From: Melton Mowbray,Leicestershire (U.K) |
|
|
|
|
Jun 3 2009, 10:23 PM
Post
#6
|
|
|
UtterAccess Addict Posts: 187 From: Darwin, Australia |
Hi,
I too have a similar request. So is it possible to post your solutions? I am using a query to poulate a report and wish to concatendate licence information into one line like the original example post. Any help appreciated. |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 23rd May 2013 - 01:19 PM |