Having trouble in searching for records in a date
range. I have two fields in a search table called
sch_low_date and sch_high_date. Keep getting an error
message when the method below is run.
The var dateString output is this
‘11-01-2006…11-15-2006|MM-dd-yyyy’
Which looks OK, but doesn’t work.
Any thoughts would be appreciated.
Best. K
if (sch_low_date == null)
{
var loDate = ‘01-01-1000’
}
else
{
var loDate = utils.dateFormat(sch_low_date,‘MM-dd-yyyy’)
}
if (sch_high_date == null)
{
var hiDate = ‘01-01-3000’
}
else
{
var hiDate = utils.dateFormat(sch_high_date,‘MM-dd-yyyy’)
}
If you are only searching for Dates - and do not need the Time element of the DateTime field it may be simpler to add a stored Calculated field to turn your date into an Integer: