Solved

SELECT and MULTYRECORD result

Posted on 2011-02-18
5
829 Views
Last Modified: 2012-06-21
Non-standards question :o)

I have data approx of this structure

record_id         var_01
==================
1                       Andy
2                       Alex
3                       Anny
.....

My task to select specific records and return Var_01
I need to return them as ONE record separated by ";" - something like

Andy;Alex;Anny;

Currently I use loop to get them separately and combine them on "client" side

The question - can I create query to return them in one record?
I cannot use stored procedures or functions (Access DB)
0
Comment
Question by:C_sharp_beaver
  • 3
  • 2
5 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 34926220
"The question - can I create query to return them in one record?
I cannot use stored procedures or functions (Access DB) "

NO. Can't be done without a function.
0
 

Author Comment

by:C_sharp_beaver
ID: 34926426
Can you please concentrate deeper in your mind ?  :o)
My boss asking about single SELECT query
0
 
LVL 77

Expert Comment

by:peter57r
ID: 34927749
Still the same answer.  There is no feature in Access/JET SQl which will create a single field from multiple records.
Yes I know you can do it in other DBMSs but you can't do it in Access without using a VBA function.
0
 

Author Closing Comment

by:C_sharp_beaver
ID: 34928076
Unfortunatelly it's "no win" situation but it was important expert opinion to backup my personal position in this request
0
 
LVL 77

Expert Comment

by:peter57r
ID: 34928210
If you google for
Access concatenate records
you will find enough sample functions to convince anyone that you can't do it without one.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Read about achieving the basic levels of HRIS security in the workplace.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now