HI
I have this in the criteria of a query field name priority
IIf([Forms]![frmTRinput]![Text103]=[priority],[forms]![frmtrinput]![text103],[priority])
[Forms]![frmTRinput]![Text103] will be any number 1-7 depending on user input.
Priority is in a table and might have any combination of numbers from 1-7 depending on tasks allocated.
What Im trying to achieve is, if a match is found show only matching records, if no match show all records that don't.
Heres the sql of the whole query
I thought I’d find the answer in Dudleys post Return All Records if IIF statement is False (read: ["*"] in IIF) but Im get lost at the dlookup part
I have this in the criteria of a query field name priority
IIf([Forms]![frmTRinput]![Text103]=[priority],[forms]![frmtrinput]![text103],[priority])
[Forms]![frmTRinput]![Text103] will be any number 1-7 depending on user input.
Priority is in a table and might have any combination of numbers from 1-7 depending on tasks allocated.
What Im trying to achieve is, if a match is found show only matching records, if no match show all records that don't.
Heres the sql of the whole query
Code:
SELECT tbl_P2E_Priorities.Priority, Max(tbl_P2E_Priorities.Finish) AS MaxOfFinish, tbl_P2E_Priorities.[Resource Name] AS ID1, IIf([priority]<=[Forms]![frmTRinput]![Text103],[finish],Date()) AS Expr1
FROM tbl_P2E_Priorities
GROUP BY tbl_P2E_Priorities.Priority, tbl_P2E_Priorities.[Resource Name], IIf([priority]<=[Forms]![frmTRinput]![Text103],[finish],Date())
HAVING (((tbl_P2E_Priorities.Priority)=IIf([Forms]![frmTRinput]![Text103]=[priority],[forms]![frmtrinput]![text103],[priority])) AND ((tbl_P2E_Priorities.[Resource Name])="frank clarke"))
ORDER BY Max(tbl_P2E_Priorities.Finish);
I thought I’d find the answer in Dudleys post Return All Records if IIF statement is False (read: ["*"] in IIF) but Im get lost at the dlookup part