AutoSearch Date Range based on single input
Using RBEnt 6.03 in a D5 application.
Would like to have user enter a single date (i.e. '12/10/03'), and search
two different fields based on that value. It gets better though..
(SQL)
(DateField1 < dateadd(dd,6,UserDate))
AND
((DateField2 between dateadd(dd,-7,UserDate) and dateadd(dd,5,UserDate))
OR DateField2 is null )
The second condition could be simplified to:
isnull(DateField2,UserDate) between dateadd(dd,-7,UserDate) and
dateadd(dd,5,UserDate)
Either way, it gets tricky.
Thanks in advance for any help.
Would like to have user enter a single date (i.e. '12/10/03'), and search
two different fields based on that value. It gets better though..
(SQL)
(DateField1 < dateadd(dd,6,UserDate))
AND
((DateField2 between dateadd(dd,-7,UserDate) and dateadd(dd,5,UserDate))
OR DateField2 is null )
The second condition could be simplified to:
isnull(DateField2,UserDate) between dateadd(dd,-7,UserDate) and
dateadd(dd,5,UserDate)
Either way, it gets tricky.
Thanks in advance for any help.
This discussion has been closed.
Comments
on them. I created an autosearch field example to get an autosearch dialog,
and then applied the criteria to each of the dataviews. The dataviews in
this exampel do not have any autosearch criteria defined in order to show
that it works. It is a simple customer orders example where the autosearch
criteria entered by the user for a date is applied to the criteria of the
master as well as the detail.
http://www.digital-metaphors.com/tips/OneAutosearchCriteriaToMany.zip
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com