Query parameter help

  • Thread starter Thread starter Ryan Tisserand
  • Start date Start date
R

Ryan Tisserand

IIf(IsNull([Forms]![C25]![StartDateFilter]),[Date1],[Forms]![C25]![StartDateFilter])
The above parameter works. If there is a date, it filters with that date,
if not, no filtering is done. I would like it to restrict by date greater
than or equal to
[Forms]![C25]![StartDateFilter])
I have tried several ways to do this to no avail. Here are two examples.
(1)
IIf(IsNull([Forms]![C25]![StartDateFilter]),[Date1],>=[Forms]![C25]![StartDateFilter])
(2)
IIf(IsNull([Forms]![C25]![StartDateFilter]),[Date1],>=([Forms]![C25]![StartDateFilter]))
Any suggestions?
 
Hopefully this is helpful...

I just had a similar problem, so used the DateValue function, which seems to
have fixed the problem. So instead of [Forms]![C25]![StartDateFilter], try
DateValue( [Forms]![C25]![StartDateFilter])
 
Can you copy your intire code so I can see. I tried using thi
IIf(IsNull([Forms]![C25]![StartDateFilter]),[Date1],>=DateValue([Forms]![C25]![StartDateFilter]))
but it told me that the expression is typed incorrectly or to complex to read.

rs0905 said:
Hopefully this is helpful...

I just had a similar problem, so used the DateValue function, which seems to
have fixed the problem. So instead of [Forms]![C25]![StartDateFilter], try
DateValue( [Forms]![C25]![StartDateFilter])


Ryan Tisserand said:
IIf(IsNull([Forms]![C25]![StartDateFilter]),[Date1],[Forms]![C25]![StartDateFilter])
The above parameter works. If there is a date, it filters with that date,
if not, no filtering is done. I would like it to restrict by date greater
than or equal to
[Forms]![C25]![StartDateFilter])
I have tried several ways to do this to no avail. Here are two examples.
(1)
IIf(IsNull([Forms]![C25]![StartDateFilter]),[Date1],>=[Forms]![C25]![StartDateFilter])
(2)
IIf(IsNull([Forms]![C25]![StartDateFilter]),[Date1],>=([Forms]![C25]![StartDateFilter]))
Any suggestions?
 
I figured out my solution. I placed this code into the query grid under the
field StartDateFilter:Date1
=IIf(IsNull([Forms]![C25]![StartDateFilter]),[Date1],[Forms]![C25]![StartDateFilter])

Ryan Tisserand said:
Can you copy your intire code so I can see. I tried using this
IIf(IsNull([Forms]![C25]![StartDateFilter]),[Date1],>=DateValue([Forms]![C25]![StartDateFilter]))
but it told me that the expression is typed incorrectly or to complex to read.

rs0905 said:
Hopefully this is helpful...

I just had a similar problem, so used the DateValue function, which seems to
have fixed the problem. So instead of [Forms]![C25]![StartDateFilter], try
DateValue( [Forms]![C25]![StartDateFilter])


Ryan Tisserand said:
IIf(IsNull([Forms]![C25]![StartDateFilter]),[Date1],[Forms]![C25]![StartDateFilter])
The above parameter works. If there is a date, it filters with that date,
if not, no filtering is done. I would like it to restrict by date greater
than or equal to
[Forms]![C25]![StartDateFilter])
I have tried several ways to do this to no avail. Here are two examples.
(1)
IIf(IsNull([Forms]![C25]![StartDateFilter]),[Date1],>=[Forms]![C25]![StartDateFilter])
(2)
IIf(IsNull([Forms]![C25]![StartDateFilter]),[Date1],>=([Forms]![C25]![StartDateFilter]))
Any suggestions?
 
Back
Top