P
PC
Hi,
I am using a parameters form to select the criteria for a query. The query
currently looks something like:
Select *
from tblInvoices
Where tblInvoice.InvPeriod between forms.frmsParams.txtCriteria1 and
forms.frmsParams.txtCriteria2;
This works fine but what I would liek is an "If .... Then" statement that if
txtCriteria2 is Null then ([tblInvoices].[InvPeriod] = (Select
Max(InvPeriod) from tblInvoices))
I've tried this with no joy:
WHERE (IF (IsNull(forms.frmsParams.txtCriteria2)=False Then
(((tblInvoices.InvPeriod) Between tblInvoice.InvPeriod between
forms.frmsParams.txtCriteria1 and forms.frmsParams.txtCriteria2
Else ([tblInvoices].[InvPeriod] = (Select Max(InvPeriod) from tblInvoices))
Any suggestions?
Thanks
Paul
I am using a parameters form to select the criteria for a query. The query
currently looks something like:
Select *
from tblInvoices
Where tblInvoice.InvPeriod between forms.frmsParams.txtCriteria1 and
forms.frmsParams.txtCriteria2;
This works fine but what I would liek is an "If .... Then" statement that if
txtCriteria2 is Null then ([tblInvoices].[InvPeriod] = (Select
Max(InvPeriod) from tblInvoices))
I've tried this with no joy:
WHERE (IF (IsNull(forms.frmsParams.txtCriteria2)=False Then
(((tblInvoices.InvPeriod) Between tblInvoice.InvPeriod between
forms.frmsParams.txtCriteria1 and forms.frmsParams.txtCriteria2
Else ([tblInvoices].[InvPeriod] = (Select Max(InvPeriod) from tblInvoices))
Any suggestions?
Thanks
Paul