F
Fluffygoldfish
I have set up a Union Select Query, from several different queries and it
returns the results I want (see below). However I would like to add an
additional column that shows which query the data came from, as my manager
wants to see who is out of normal work and why (i.e. for leave, lieu,
training or absence) at the click of a button.
SELECT [Name], [Surname], [Start Date], [End Date]
FROM [AL between dates]
UNION ALL SELECT [Name], [Surname], [Lieu From], [Lieu To]
FROM [Lieu between dates];
UNION ALL SELECT [Name], [Surname], [First day of absence], [Last day of
absence]
FROM [Absent];
UNION ALL SELECT [Name], [Surname], [Start Date], [End Date]
FROM [Training between dates];
Is there a better way to set it up? Or do I need to make the source
information available in the select query? If so how?
Thanks for any help x
returns the results I want (see below). However I would like to add an
additional column that shows which query the data came from, as my manager
wants to see who is out of normal work and why (i.e. for leave, lieu,
training or absence) at the click of a button.
SELECT [Name], [Surname], [Start Date], [End Date]
FROM [AL between dates]
UNION ALL SELECT [Name], [Surname], [Lieu From], [Lieu To]
FROM [Lieu between dates];
UNION ALL SELECT [Name], [Surname], [First day of absence], [Last day of
absence]
FROM [Absent];
UNION ALL SELECT [Name], [Surname], [Start Date], [End Date]
FROM [Training between dates];
Is there a better way to set it up? Or do I need to make the source
information available in the select query? If so how?
Thanks for any help x