Append Query with mulitple select queries (1 Viewer)

kobiashi

Registered User.
Local time
Today, 03:54
Joined
May 11, 2018
Messages
258
hi

so i have a form with 8 unbound sub forms, each sub form is attached to a select query, each query is filtered uniquely, such as one date field is filtered to show just todays events,

the date that is displayed in these sub forms can be changed for the source table, so i need the ability to save the current data in the sub forms, to a unique id, so it can be viewed historically.

i thought of using a append query. so my question is can i create an append query that has multiple select queries?
 

WayneRyan

AWF VIP
Local time
Today, 03:54
Joined
Nov 19, 2002
Messages
7,122
Kobiashi,

Your append query should be a union query; even if some of the components have no rows.

Wayne
 

kobiashi

Registered User.
Local time
Today, 03:54
Joined
May 11, 2018
Messages
258
Hi Wayne Ryan

Thanks for the reply, can I use a union query even if the fields are not the same in the select queries?
 

WayneRyan

AWF VIP
Local time
Today, 03:54
Joined
Nov 19, 2002
Messages
7,122
Draw,

That’s a good link ... but they say “usually” the same named columns. To not confuse kobiashi: each of the Union queries must agree in data type and number.

Wayne
 

jdraw

Super Moderator
Staff member
Local time
Yesterday, 22:54
Joined
Jan 23, 2006
Messages
15,379
Wayne agreed.

I was hoping the OP would read these, then try the example.
(from w3schools)
The UNION operator is used to combine the result-set of two or more SELECT statements.

Each SELECT statement within UNION must have the same number of columns
The columns must also have similar data types
The columns in each SELECT statement must also be in the same order
 

WayneRyan

AWF VIP
Local time
Today, 03:54
Joined
Nov 19, 2002
Messages
7,122
J,

Duh ... I quickly scanned it and missed the very first part !

I was just focused on the note.

Wayne
 

Users who are viewing this thread

Top Bottom