I know this has been discussed previously, but I'm still unclear on this...
I have a form that collects client data. A client could be removed from the system and then reinstated so they could have 1 or 2 discharge dates. I'm trying to capture all the discharged clients within a specific date range regardless if they are a 1st time or 2nd time discharge as long as they are in the inputed range.
SELECT tblCases.[Last Name], tblCases.[First Name], codeDischarge.[Discharge description], tblCases.[Discharge Date], tblCases.[DischargeDate2]
FROM tblCases INNER JOIN codeDischarge ON tblCases.[Discharge Code] = codeDischarge.[Discharge Code]
WHERE (((tblCases.WaitingList)=No)) AND tblCases.[DischargeDate2] =
CASE WHEN (tblCases.[DischargeDate2]) IS NULL THEN
(tblCases.[Discharge Date]) Between [enter startdate] And [enter enddate])
ELSE
((tblCases.[DischargeDate2]) Between [enter startdate] And [enter enddate]))
Can someone tell me what's wrong with this code?
Thanks!
I have a form that collects client data. A client could be removed from the system and then reinstated so they could have 1 or 2 discharge dates. I'm trying to capture all the discharged clients within a specific date range regardless if they are a 1st time or 2nd time discharge as long as they are in the inputed range.
SELECT tblCases.[Last Name], tblCases.[First Name], codeDischarge.[Discharge description], tblCases.[Discharge Date], tblCases.[DischargeDate2]
FROM tblCases INNER JOIN codeDischarge ON tblCases.[Discharge Code] = codeDischarge.[Discharge Code]
WHERE (((tblCases.WaitingList)=No)) AND tblCases.[DischargeDate2] =
CASE WHEN (tblCases.[DischargeDate2]) IS NULL THEN
(tblCases.[Discharge Date]) Between [enter startdate] And [enter enddate])
ELSE
((tblCases.[DischargeDate2]) Between [enter startdate] And [enter enddate]))
Can someone tell me what's wrong with this code?
Thanks!