M
Moon
Hi all,
I'm getting the error in the subject when I execute this query.
SELECT [Table 1].Key
FROM [Table 1] RIGHT JOIN [Query Date Visits] ON [Table 1].Key = [Query
Date Visits].Key
GROUP BY [Table 1].KeyPatient, [Table 1].Gender, [Query Date
Visits].elpsdDays
HAVING ((([Table 1].Gender)=1) AND (([Query Date
Visits].elpsdDays)>365))
ORDER BY [Query Date Visits].elpsdDays;
QUery Date Visit is as follow:
SELECT T1.Key, Max(T1.DatVisit) AS MaxOfDatVisit, Min(T1.DatVisit) AS
MinOfDatVisit, DateDiff("d",[MinOfDatVisit],[MaxOfDatVisit]) AS
elpsdDays
FROM [Table 1] AS T1
GROUP BY T1.Key
HAVING (((Max(T1.DatVisit)) Is Not Null) AND ((Min(T1.DatVisit)) Is Not
Null));
The above query finds the number of days between the max date and min
date.
The first query should return all the Keys with elpsdDays > 365 but I'm
getting the error instead.
Can someone tell me where I'm going wrong?
THanks so much,
Moon
I'm getting the error in the subject when I execute this query.
SELECT [Table 1].Key
FROM [Table 1] RIGHT JOIN [Query Date Visits] ON [Table 1].Key = [Query
Date Visits].Key
GROUP BY [Table 1].KeyPatient, [Table 1].Gender, [Query Date
Visits].elpsdDays
HAVING ((([Table 1].Gender)=1) AND (([Query Date
Visits].elpsdDays)>365))
ORDER BY [Query Date Visits].elpsdDays;
QUery Date Visit is as follow:
SELECT T1.Key, Max(T1.DatVisit) AS MaxOfDatVisit, Min(T1.DatVisit) AS
MinOfDatVisit, DateDiff("d",[MinOfDatVisit],[MaxOfDatVisit]) AS
elpsdDays
FROM [Table 1] AS T1
GROUP BY T1.Key
HAVING (((Max(T1.DatVisit)) Is Not Null) AND ((Min(T1.DatVisit)) Is Not
Null));
The above query finds the number of days between the max date and min
date.
The first query should return all the Keys with elpsdDays > 365 but I'm
getting the error instead.
Can someone tell me where I'm going wrong?
THanks so much,
Moon