G
Guest
I'm trying to write a query that displays records based on dates the user enters. If the user doesn't enter anything, then it'll use the min(date). Is there something wrong with this query?
SELECT * FROM History WHERE (TransType Like "P*" Or TransType Like "N*")
AND
TranDate >= IIf(IsNull([Forms]![UnivCriteriaFrm].[txtFrom]),select min(trandate) from history, [Forms]![UnivCriteriaFrm].[txtFrom])
Also, when I click OK on the syntax error messagebox, it highlights the 2nd part of the query: select min(trandate) from history, [Forms]![UnivCriteriaFrm].[txtFrom])
What am I doing wrong?
Thanks.
SELECT * FROM History WHERE (TransType Like "P*" Or TransType Like "N*")
AND
TranDate >= IIf(IsNull([Forms]![UnivCriteriaFrm].[txtFrom]),select min(trandate) from history, [Forms]![UnivCriteriaFrm].[txtFrom])
Also, when I click OK on the syntax error messagebox, it highlights the 2nd part of the query: select min(trandate) from history, [Forms]![UnivCriteriaFrm].[txtFrom])
What am I doing wrong?
Thanks.