U
upandaway
The main form “frm_Days_At_Hospital†has two sub forms. All forms should show
data of the same date range (i.e. Admission Date from 03/01/06 till 03/19/06)
having the user to state the date range for the main form only and not for
the two sub forms individually also (In total thus three times).
SQL-Statement of the main form’s query:
SELECT [AD Absent Sick].[Admission Date], [AD Absent Sick].Discharged,
(DateDiff("d",[Admission Date],[Discharged])+1) AS DaysDischarged,
(DateDiff("d",[Discharged],Date())) AS DaysDischargedTillToday,
(DateDiff("d",[Admission Date],Date())+1) AS DaysAdmTillToday,
[DaysDischargedTillToday]+[DaysDischarged] AS Substract, [AD Absent
Sick].Clinic, [AD Absent Sick].[Admission Date] AS StartDate, [AD Absent
Sick].Discharged AS EndDate
FROM [AD Absent Sick]
WHERE ((([AD Absent Sick].[Admission Date]) Between [StartDate] And
[EndDate]));
SQL-Statement of one of the sub form’s query:
SELECT [AD Absent Sick].[Admission Date], [AD Absent Sick].Discharged, [AD
Absent Sick].Clinic, (DateDiff("d",[Admission Date],[Discharged])+1) AS
DaysDischarged, (DateDiff("d",[Discharged],Date())) AS
DaysDischargedTillToday, (DateDiff("d",[Admission Date],Date())+1) AS
DaysAdmTillToday, [DaysDischargedTillToday]+[DaysDischarged] AS Substract
FROM [AD Absent Sick]
WHERE ((([AD Absent Sick].Clinic)="BBG"));
Thank you for any help
data of the same date range (i.e. Admission Date from 03/01/06 till 03/19/06)
having the user to state the date range for the main form only and not for
the two sub forms individually also (In total thus three times).
SQL-Statement of the main form’s query:
SELECT [AD Absent Sick].[Admission Date], [AD Absent Sick].Discharged,
(DateDiff("d",[Admission Date],[Discharged])+1) AS DaysDischarged,
(DateDiff("d",[Discharged],Date())) AS DaysDischargedTillToday,
(DateDiff("d",[Admission Date],Date())+1) AS DaysAdmTillToday,
[DaysDischargedTillToday]+[DaysDischarged] AS Substract, [AD Absent
Sick].Clinic, [AD Absent Sick].[Admission Date] AS StartDate, [AD Absent
Sick].Discharged AS EndDate
FROM [AD Absent Sick]
WHERE ((([AD Absent Sick].[Admission Date]) Between [StartDate] And
[EndDate]));
SQL-Statement of one of the sub form’s query:
SELECT [AD Absent Sick].[Admission Date], [AD Absent Sick].Discharged, [AD
Absent Sick].Clinic, (DateDiff("d",[Admission Date],[Discharged])+1) AS
DaysDischarged, (DateDiff("d",[Discharged],Date())) AS
DaysDischargedTillToday, (DateDiff("d",[Admission Date],Date())+1) AS
DaysAdmTillToday, [DaysDischargedTillToday]+[DaysDischarged] AS Substract
FROM [AD Absent Sick]
WHERE ((([AD Absent Sick].Clinic)="BBG"));
Thank you for any help