B
bruch04
Hi. This is the following SQL statement. I'm getting no records
returned. If I remove the where clause it's fine. I understand it's
probably a problem with the fact that column 5 ([Due Date]) is
calculated from column 4 ([CalDate]), but none of the answers to
previous posts seem to work for me.
By the way, the IIf statement looks fairly complex, but it just
calculates a date based on the most recent follow-up report we've
received (up to 8). Then Due Date checks to see if the case was fatal
or not and adds the appropriate number of days we have to submit the
report to the authorities.
***
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 someone figure out why no records are being retrieved? Thanks.
I'm pretty new at Access.
returned. If I remove the where clause it's fine. I understand it's
probably a problem with the fact that column 5 ([Due Date]) is
calculated from column 4 ([CalDate]), but none of the answers to
previous posts seem to work for me.
By the way, the IIf statement looks fairly complex, but it just
calculates a date based on the most recent follow-up report we've
received (up to 8). Then Due Date checks to see if the case was fatal
or not and adds the appropriate number of days we have to submit the
report to the authorities.
***
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 someone figure out why no records are being retrieved? Thanks.
I'm pretty new at Access.