One query record results as 2 separate lines??

G

GD

Is it possible to design a query to result in 2 separate lines per record?
Let's say I have the following as fields: invoice #, date, amount, approved
by, approval date. Can I get it to result in (including indentation, if
possible)?:

Record 1.invoice # Record 1.date Record 1.amount
Record 1.approved by Record 1.approval
date
Record 2.invoice # Record 2.date Record 2.amount
Record 2.approved by Record 2.approval
date
etc,etc,...

Or is a report necessary to accomplish this?

Thanks!!!!
 
K

KARL DEWEY

UNTESTED --
SELECT [invoice #] AS [Invoice], [date] AS [Date / Approved By], [amount] AS
[Amount / Approved], 1 AS Record
FROM YourTable
UNION ALL SELECT Null, [approved by] AS [Date / Approved By], [approval] AS
[Amount / Approved], 2 AS Record
FROM YourTable
ORDER BY [invoice #];
 
K

KenSheridan via AccessMonster.com

Forget about trying to control the layout with a query. First create a
simple query which returns the relevant rows/columns. If you want to print
the results create a report, but if you simply want to show the results on
the screen create a form and lay the controls out in the format you want.
Set its DefaultView property to 'Continuous Forms'. You then simply open the
form rather than the query.

Remember that if you use a report it should be sorted by means of the reports
internal 'sorting and grouping' mechanism not by an ORDER BY clause in the
underlying query. For a form, however, sort the underlying query by means of
its ORDER BY clause to control the order of the records in the form.

Ken Sheridan
Stafford, England
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top