finding date ranges in method

Questions, tips and tricks and techniques for scripting in Servoy

finding date ranges in method

Postby drookwood » Tue Feb 17, 2004 7:35 pm

I can't seem to get this to work. I have looked at the other posts re date range finds but nothing I try works!

Can someone tell me where I am going wrong?
Option1:

Code: Select all
var d1 = utils.dateFormat( globals.search_date1, '|dd-MM-yyyy');
var d2 = utils.dateFormat( globals.search_date2, '|dd-MM-yyyy');
controller.find();
creation_date = d1 + '|dd-MM-yyyy' +'...'+ d2 + '|dd-MM-yyyy';
controller.search();

Option 2:
Code: Select all
controller.find();
creation_date = globals.search_date1 + '|dd-MM-yyyy' +'...'+ globals.search_date2 + '|dd-MM-yyyy';
controller.search();


Both the above run without errors but simply find all records!
David Rookwood

SAN Developer
drookwood
 
Posts: 290
Joined: Tue Nov 11, 2003 7:08 pm
Location: Somerset, UK

Postby drookwood » Tue Feb 17, 2004 7:50 pm

Cracked it!
finally found the variation that works:
Code: Select all
var d1 = utils.dateFormat(globals.search_date1, 'dd-MM-yyyy');
var d2 = utils.dateFormat(globals.search_date2, 'dd-MM-yyyy');
controller.find();
creation_date = d1+'...'+d2+'|dd-MM-yyyy' ;
controller.search();


It always looks so simple when you finally get it!
David Rookwood

SAN Developer
drookwood
 
Posts: 290
Joined: Tue Nov 11, 2003 7:08 pm
Location: Somerset, UK


Return to Methods

Who is online

Users browsing this forum: No registered users and 32 guests

cron