How can I get the Next Record fields in the same Query

E

efandango

I have two identical queries, but want one half of the records to come from
Primary Key record 1, and the second half of the records to come from Primary
Key record 2. The Primary Key is: Run_point_List_ID


Run_point_List_ID Run_No Run_point_Venue_A Run_point_Address_A Run_point_List_ID2 Run_point_Venue_A Run_point_Address_A
377 1 Health Centre 23 Main Street 378 Central Hotel 32 South Street

I can manage to get both columns for Run_point_List_ID, with this line in
the QBE grid: Run_point_List_ID2: ([QRY_Reports_Points 3 alternate copy
2].[Run_point_List_ID]+1), but cannot work out how to say, show the next
record index for fields: [Run_point_Venue_A] and [Run_point_Address_A]

can someone tell me of this is even possible?
 
J

Jeanette Cunningham

Hi,
sounds as if you want to combine both the queries into 1 query.
If this is what you want to do, use a union query.
If union queries are new
--start a new query in SQL view
--paste in the sql of the 1st query
--delete the semicolon at end
--on the next line type the word union
--on the next line paste the sql of the 2nd query

Note* with a union query each of the separate queries needs to have the same
number of fields
If you have an order by clause at the end of the union query, put only the
name of the field to order by, not the table name followed by dot by the
field name.

Jeanette Cunningham
 
E

efandango

I understand what Union Query is, But how can get one half of the fields from
the 1st primary field, and the other set of fields from the 2nd Primary field?



Jeanette Cunningham said:
Hi,
sounds as if you want to combine both the queries into 1 query.
If this is what you want to do, use a union query.
If union queries are new
--start a new query in SQL view
--paste in the sql of the 1st query
--delete the semicolon at end
--on the next line type the word union
--on the next line paste the sql of the 2nd query

Note* with a union query each of the separate queries needs to have the same
number of fields
If you have an order by clause at the end of the union query, put only the
name of the field to order by, not the table name followed by dot by the
field name.

Jeanette Cunningham


efandango said:
I have two identical queries, but want one half of the records to come from
Primary Key record 1, and the second half of the records to come from
Primary
Key record 2. The Primary Key is: Run_point_List_ID


Run_point_List_ID Run_No Run_point_Venue_A Run_point_Address_A
Run_point_List_ID2 Run_point_Venue_A Run_point_Address_A
377 1 Health Centre 23 Main Street 378 Central Hotel 32 South Street

I can manage to get both columns for Run_point_List_ID, with this line in
the QBE grid: Run_point_List_ID2: ([QRY_Reports_Points 3 alternate copy
2].[Run_point_List_ID]+1), but cannot work out how to say, show the next
record index for fields: [Run_point_Venue_A] and [Run_point_Address_A]

can someone tell me of this is even possible?
 

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