Right I will try
It a database that captures core details of young people and then they attend certain pre-education/education/mentoring/casework sessions which can be anything from 3 to 24 sessions for each but it depends.
I have a tabbed entry form with the main core fields coming through an subforms to capture the attendance data in separate tables - all of which link using the IDs which are in each table.
I am required to report on all Attendees for a given period (using a separate form to capture the Attendance Date) and also all Attendances plus Attendee Dempgraphics etc.
(This is very convoluted) As the date range wasn't working I created a Select UNION, then created a query that would Make a table of the data, then another Select query to use for my reports.
As I am sure you can tell - my talents do not necessarily lie in the programming camp!
UNION Query Below:
SELECT tblAttendance12Weekprogramme.FFPID, tblAttendance12Weekprogramme.[Attendance Date], tblAttendance12Weekprogramme.[Attendance Mark], Format([Attendance Date],"mmmm") AS [Month], Format([Attendance Date], "mm") AS [MonthNo]
FROM tblAttendance12Weekprogramme
WHERE (((tblAttendance12Weekprogramme.[Attendance Mark])="1"))
UNION ALL
SELECT tblAttendanceMentoring.FFPID, tblAttendanceMentoring.[Attendance Date], tblAttendanceMentoring.[Attendance Mark], Format([Attendance Date],"mmmm") AS [Month], Format([Attendance Date], "mm") AS [MonthNo]
FROM tblAttendanceMentoring
WHERE (((tblAttendanceMentoring.[Attendance Mark])=1))
UNION ALL
SELECT tblAttendancePathway.FFPID, tblAttendancePathway.[Attendance Date], tblAttendancePathway.[Attendance Mark], Format([Attendance Date],"mmmm") AS [Month], Format([Attendance Date], "mm") AS [MonthNo]
FROM tblAttendancePathway
WHERE (((tblAttendancePathway.[Attendance Mark])=1))
UNION ALL SELECT tblAttendancePrePathway.FFPID, tblAttendancePrePathway.[Attendance Date], tblAttendancePrePathway.[Attendance Mark], Format([Attendance Date],"mmmm") AS [Month], Format([Attendance Date], "mm") AS [MonthNo]
FROM tblAttendancePrePathway
WHERE (((tblAttendancePrePathway.[Attendance Mark])=1));
Make Table Query:
SELECT qryAttendancesUNION.FFPID, qryAttendancesUNION.[Attendance Date] AS Attendance, qryAttendancesUNION.Month, qryAttendancesUNION.MonthNo, qryAttendancesUNION.[Attendance Mark] AS Mark INTO tblAllAttendanceData
FROM qryAttendancesUNION;
Query used for reports:
SELECT tblAllAttendanceData.FFPID, tblAllAttendanceData.Month, tblAllAttendanceData.MonthNo, tblAllAttendanceData.Attendance, tblAllAttendanceData.Mark
FROM tblAllAttendanceData
WHERE (((tblAllAttendanceData.Attendance) Between [Forms]![frmDateRangeReport]![FromDate] And [Forms]![frmDateRangeReport]![ToDate]) AND ((tblAllAttendanceData.Mark)="1"));
No doubt I have confused things further...
Paul