Hi
I'm after a bit of advice. I need the uses to be able to either select a single date and operator or a date range.
I've set up a prompt for the single date and for the operator (=, <,>,<=,>=) and wanted to add both parameters into the filter but kept getting errors.
The filter looked something like this;
date ?date operator? ?date parameter?
I ended up having to break the date operator out and ended up with a much bigger filter.
Any ideas on why I was getting errors with the first filter and how I should have written it?
As always thanks for the help.
Date In_range ?parm?
or
Date between ?fromParm? and ?toParm?
Thanks but I think it was passing the 2 parameters (date and operator) to the filter that was causing the issue.
Not really sure what you mean, or how you can pass 2 unrelated parameters to one query subject??? Also, You simply Can't filter a date column on a non-date parameter.
Set up separate filters for each query item that you are filtering on.
I think you're probably right.
What I was trying to do was to get the users to select the operator they wanted as well as the date so that
?date_operator? would be one of =, <, >, <=, >=
and ?date? would be a date
then I was trying to say something like
sales_date ?date_operator? ?date?
so it would read sales_date = 2008-03-14 etc
with the = being the value from the ?date_operator?
=
<> value
I doubt you can store 'non-values' in a parameter, though it would be mighty nice :)
I played with a similar approach once, you'll need to format your filter something like:
(?date_operator? = '>' and [dbdate]>?date?)
or
(?date_operator? = '=' and [dbdate]=?date?)
or
etc.
Yeah that's what I ended up doing, thought there might be a 'nicer' way of doing.
Thanks for all your help again ;D