Page 1 of 1

show only related records with a date greater than today

PostPosted: Wed Jun 02, 2010 10:38 am
by gabid
Hello guys
I'm trying to display a list of records based on a relationship, but only those that have a start_date greater than today.
I made a global variable vTodayMorning which I set to this morning:

Code: Select all
globals.vTodayMorning = new Date();
globals.vTodayMorning.setHours(0,0,0,0);


then I create a relationship where I select on the related table start_date >= globals.vTodayMorning, but it shows all records. What am I doing wrong?

Thanks
Gabriel

Re: show only related records with a date greater than today

PostPosted: Wed Jun 02, 2010 11:00 am
by pbakker
This ought to work. Can you have a look at the query fired at the database?

Paul

Re: show only related records with a date greater than today

PostPosted: Wed Jun 02, 2010 11:19 am
by gabid
Thank you Paul for your answer. Is there a way to see the sent querry, other than sniffing on the connection?

Gabriel

Re: show only related records with a date greater than today

PostPosted: Wed Jun 02, 2010 11:44 am
by pbakker
On the Servoy Admin pages you can see the queries in the Performance log

Paul

Re: show only related records with a date greater than today

PostPosted: Wed Jun 02, 2010 12:05 pm
by gabid
Silly me,
it was working, only that the comparison sign should have been the other way around. This is what happens when you do it in a hurry.

The global variable is, of course, on the left side of a relationship, so I should have said globals.vTodayMorning <= start_date.

Please close and delete this thread :D

Thanks,
Gabriel