Dragonous24
New member
- Local time
- Today, 10:40
- Joined
- Feb 6, 2020
- Messages
- 15
So i have 2 Queries i'm combining into 1 with a Union Query.
Table 2 has a date field that Table 1 doesn't and so it needs to be created/defined in table 1 which i have done like this:
But this is making that column a text field and so the dates from table 2 don't act as date, they act as text.
How do i change this so the field is defined as a date field.
Full Union SQL below.
Table 2 has a date field that Table 1 doesn't and so it needs to be created/defined in table 1 which i have done like this:
""as [fld_Date_trec]
But this is making that column a text field and so the dates from table 2 don't act as date, they act as text.
How do i change this so the field is defined as a date field.
Full Union SQL below.
SQL:
SELECT [qryP+G+Treq].fld_GroupID_gm, [qryP+G+Treq].FirstOffld_CourseID_treq, [qryP+G+Treq].fld_ID_pers, [qryP+G+Treq].fld_Name_group, [qryP+G+Treq].fld_Surname_pers, [qryP+G+Treq].fld_Forename_pers, [qryP+G+Treq].fld_EmployedFrom_pers, [qryP+G+Treq].fld_EmployedTo_pers, [qryP+G+Treq].fld_Name_course, "" as [fld_StatID_trec], "" as [fld_Name_stat],""as [fld_Date_trec], "" as [fld_Lifespan_course], "" as [Valid_Until], "" as [Valid]
FROM [qryP+G+Treq]
WHERE ((( [qryP+G+Treq].FirstOffld_CourseID_treq) is not null));
UNION
SELECT [qryP+G+Trec].fld_GroupID_gm, [qryP+G+Trec].fld_CourseID_trec, [qryP+G+Trec].fld_ID_pers, [qryP+G+Trec].fld_Name_group, [qryP+G+Trec].fld_Surname_pers, [qryP+G+Trec].fld_Forename_pers, [qryP+G+Trec].fld_EmployedFrom_pers, [qryP+G+Trec].fld_EmployedTo_pers, [qryP+G+Trec].fld_Name_course, [qryP+G+Trec].fld_StatID_trec, [qryP+G+Trec].fld_Name_stat, [qryP+G+Trec].fld_Date_trec,[qryP+G+Trec].fld_Lifespan_course, [qryP+G+Trec].Valid_Until, [qryP+G+Trec].Valid
FROM [qryP+G+Trec]
where ((( [qryP+G+Trec].fld_CourseID_trec) is not null))
ORDER BY [qryP+G+Treq].fld_Name_group, [qryP+G+Treq].fld_Surname_pers, [qryP+G+Treq].fld_Forename_pers;