PDA

View Full Version : Range question


ABC123

thomas ohm
05-07-2001, 01:25 PM
I'm trying to search for a date in a set. The date field is located in child record. I'm having trouble getting the range.filter to accept a date. below is the script I want to use on a button. I keep getting invalid constant on the range.filter line. Any help would be great!

thanks!


date_string=ui_get_date("Scheduler","Which date?")
range_drop(db_current())
range.flags = RANGE_FILTER .or. RANGE_MARKED
range.index_handle = index_record_get(db_current())

range.filter = "SCHED->DATE="+date_string

range.index_handle = index_record_get(db_current())
range_add(db_current(), 0, 0)
dbh=db_current()
fetch_first(dbh)
card_resynch()

Thomas Henkel
05-15-2001, 10:29 AM
Tom,

You realize that the ui_get_date returns a string, not a real date. For it to be used as a date field, it would need to be converted with a ctod function.

I believe that your range.filter

range.filter = "SCHED->DATE="+date_string

should read

range.filter = "SCHED->DATE= ctod(date_string)"

Range filters have always bothered me, but give tis a try.

Tom

thomas ohm
05-16-2001, 08:55 PM
Yup... stupid me! Thank you!