B
bruch04
Hi. The following query retrieves no records. If I remove the WHERE
statement it works fine. I understand it's probably because column 5
(Due Date) is calculated from column 4 (CalDate), but none of the
answers to previous posts seem to help.
The IIF statements look pretty complex, but they just mean that CalDate
checks to see what the most recent follow-up report is that we've
recieved (up to 8), and DueDate adds either 3 days or 7 days to that
date based on whether the case was fatal or not.
SELECT SAE.PILast, SAE.Ptno, SAE.Event,
IIf(IsNull([FU8]),IIf(IsNull([FU7]),IIf(IsNull([FU6]),IIf(IsNull([FU5]),IIf(IsNull([FU4]),IIf(IsNull([FU3]),IIf(IsNull([FU2]),IIf(IsNull([FU1]),[Initial],[FU1]),[FU2]),[FU3]),[FU4]),[FU5]),[FU6]),[FU7]),[FU8])
AS CalDate,
IIf([Fatal]=1,DateAdd("d",3,[CalDate]),DateAdd("d",7,[CalDate])) AS
[Due Date], SAE.Fatal
FROM SAE
WHERE (((5) Between Date() And DateAdd("m",3,Date())))
ORDER BY 5;
Can anyone figure out why no records are retrieved? Thanks. I'm
pretty new at Access.
statement it works fine. I understand it's probably because column 5
(Due Date) is calculated from column 4 (CalDate), but none of the
answers to previous posts seem to help.
The IIF statements look pretty complex, but they just mean that CalDate
checks to see what the most recent follow-up report is that we've
recieved (up to 8), and DueDate adds either 3 days or 7 days to that
date based on whether the case was fatal or not.
SELECT SAE.PILast, SAE.Ptno, SAE.Event,
IIf(IsNull([FU8]),IIf(IsNull([FU7]),IIf(IsNull([FU6]),IIf(IsNull([FU5]),IIf(IsNull([FU4]),IIf(IsNull([FU3]),IIf(IsNull([FU2]),IIf(IsNull([FU1]),[Initial],[FU1]),[FU2]),[FU3]),[FU4]),[FU5]),[FU6]),[FU7]),[FU8])
AS CalDate,
IIf([Fatal]=1,DateAdd("d",3,[CalDate]),DateAdd("d",7,[CalDate])) AS
[Due Date], SAE.Fatal
FROM SAE
WHERE (((5) Between Date() And DateAdd("m",3,Date())))
ORDER BY 5;
Can anyone figure out why no records are retrieved? Thanks. I'm
pretty new at Access.