Page 1 of 1

Finding Records Question

PostPosted: Mon Mar 29, 2004 6:03 pm
by rochard
I want to create a method that will find all records created for the current date and then sort them in descending order; very easy to do in FileMaker but not at all obvious in Servoy.

Also how do you find records that have a Null value in a specific field?

TIA

PostPosted: Mon Mar 29, 2004 6:15 pm
by pbakker
Maytbe this gets you going...

controller.find();
enddate = '^' //Gets records where the enddate is null
controller.newRecord();
enddate = ">=" + utils.dateFormat(new Date(),'dd-MM-yyyy')+ '|dd-MM-yyyy'; //Where enddate >= than current date
controller.search();


Paul

Re: Finding Records Question

PostPosted: Mon Mar 29, 2004 6:15 pm
by bcusick
rochard wrote:I want to create a method that will find all records created for the current date and then sort them in descending order; very easy to do in FileMaker but not at all obvious in Servoy.

Also how do you find records that have a Null value in a specific field?

TIA


Searching for current date:

var today = new Date()
controller.find()
dateField = '#' + today
controller.search()


Searching for a null value:

controller.find()
field = '^'
controller.search()

You can see a listing of all tokens used in searches by accessing the Servoy Help (F1 or choose from "Help" menu) - and going to the "Search" tab and enter "find" (no quotes) in the search box and clicking "Search".

Hope this helps,

Bob Cusick