David R
I know a few things...
- Local time
- Today, 10:33
- Joined
- Oct 23, 2001
- Messages
- 2,633
I'm trying to make my query robust enough to count differently on Friday than Monday, but it keeps evaluating the criterion to '2' no matter what. For now I have to switch between two versions, one for M-Th and one for Fridays.
Relevant field and criterion: [Forms]![Data]![txtInspDate]-[Activity Created]-[AddDays] > IIf(Weekday([Forms]![Data]![txtInspDate])=2,2,0)
Full SQL if necessary:
Search is failing me due to the common terms.
Relevant field and criterion: [Forms]![Data]![txtInspDate]-[Activity Created]-[AddDays] > IIf(Weekday([Forms]![Data]![txtInspDate])=2,2,0)
Full SQL if necessary:
Code:
SELECT TOP 13 ImportTemp.[Empl ID], ImportTemp.[Inspection Activity], ImportTemp.[SO ID], [Forms]![Data]![txtInspDate]-[Activity Created]-[AddDays] AS DPDMax, IIf(Weekday([Forms]![Data]![txtInspDate])=2,2,0) AS Weekd
FROM [Priority List] INNER JOIN ImportTemp ON [Priority List].Activity = ImportTemp.[Inspection Activity]
WHERE (((ImportTemp.[Empl ID])=[Forms]![formReview]![eid]) AND ((ImportTemp.[Inspection Activity]) Like "*inspect*") AND (([Forms]![Data]![txtInspDate]-[Activity Created]-[AddDays])>IIf(Weekday([Forms]![Data]![txtInspDate])=2,2,0)) AND ((ImportTemp.[Provider Group])<>"NCS-HazardousStructure"))
ORDER BY [Priority List].Priority, [Forms]![Data]![txtInspDate]-[Activity Created]-[AddDays] DESC;
Search is failing me due to the common terms.