# show only related records with a date greater than today

**URL:** <https://forum.servoy.com/t/show-only-related-records-with-a-date-greater-than-today/12273>\
**Category:** Classic Servoy\
**Created:** [June 2, 2010, 8:38am UTC](https://forum.servoy.com/t/show-only-related-records-with-a-date-greater-than-today/12273 "2010-06-02T08:38:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabid](https://avatars.discourse-cdn.com/v4/letter/g/7ab992/32.png) [@gabid](https://forum.servoy.com/u/gabid)\
**Post date:** [June 2, 2010, 8:38am UTC](https://forum.servoy.com/t/show-only-related-records-with-a-date-greater-than-today/12273/1 "2010-06-02T08:38:12Z")

</div>

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:

```auto
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

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [June 2, 2010, 9:00am UTC](https://forum.servoy.com/t/show-only-related-records-with-a-date-greater-than-today/12273/2 "2010-06-02T09:00:42Z")

</div>

This ought to work. Can you have a look at the query fired at the database?

Paul

---

<div class="post-metadata">

**Author:** ![gabid](https://avatars.discourse-cdn.com/v4/letter/g/7ab992/32.png) [@gabid](https://forum.servoy.com/u/gabid)\
**Post date:** [June 2, 2010, 9:19am UTC](https://forum.servoy.com/t/show-only-related-records-with-a-date-greater-than-today/12273/3 "2010-06-02T09:19:49Z")

</div>

Thank you Paul for your answer. Is there a way to see the sent querry, other than sniffing on the connection?

Gabriel

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [June 2, 2010, 9:44am UTC](https://forum.servoy.com/t/show-only-related-records-with-a-date-greater-than-today/12273/4 "2010-06-02T09:44:20Z")

</div>

On the Servoy Admin pages you can see the queries in the Performance log

Paul

---

<div class="post-metadata">

**Author:** ![gabid](https://avatars.discourse-cdn.com/v4/letter/g/7ab992/32.png) [@gabid](https://forum.servoy.com/u/gabid)\
**Post date:** [June 2, 2010, 10:05am UTC](https://forum.servoy.com/t/show-only-related-records-with-a-date-greater-than-today/12273/5 "2010-06-02T10:05:51Z")

</div>

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]( "Very Happy")

Thanks,  
Gabriel
