Finding Records Question

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Finding Records Question

Postby rochard » Mon Mar 29, 2004 6:03 pm

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
Michael Rochard
rochard
 
Posts: 142
Joined: Thu Jan 29, 2004 12:11 am

Postby pbakker » Mon Mar 29, 2004 6:15 pm

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
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Re: Finding Records Question

Postby bcusick » Mon Mar 29, 2004 6:15 pm

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
bcusick
 
Posts: 1255
Joined: Wed Apr 23, 2003 11:27 pm
Location: Thousand Oaks, CA USA


Return to Programming with Servoy

Who is online

Users browsing this forum: Google [Bot] and 8 guests