G
Guest
How can I add an If to a Select statement? The query's run based on dates
the user enters before execution.
I would like to add an If statement saying, "If
[Forms]![UnivCriteriaFrm].[txtFrom] is empty, the date used will equal
SELECT Min(TranDate) FROM table1".
The logic would be in the WHERE section...
SELECT * FROM History
WHERE (TransType Like "P*" Or TransType Like "N*")
AND TranDate >= [Forms]![UnivCriteriaFrm].[txtFrom] <-
AND TranDate<=[Forms]![UnivCriteriaFrm]![txtTo] <-
Thanks,
VM
the user enters before execution.
I would like to add an If statement saying, "If
[Forms]![UnivCriteriaFrm].[txtFrom] is empty, the date used will equal
SELECT Min(TranDate) FROM table1".
The logic would be in the WHERE section...
SELECT * FROM History
WHERE (TransType Like "P*" Or TransType Like "N*")
AND TranDate >= [Forms]![UnivCriteriaFrm].[txtFrom] <-
AND TranDate<=[Forms]![UnivCriteriaFrm]![txtTo] <-
Thanks,
VM