# search on date without time

**URL:** <https://forum.servoy.com/t/search-on-date-without-time/6681>\
**Category:** Classic Servoy\
**Created:** [November 2, 2006, 10:34am UTC](https://forum.servoy.com/t/search-on-date-without-time/6681 "2006-11-02T10:34:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chgog](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@chgog](https://forum.servoy.com/u/chgog)\
**Post date:** [November 2, 2006, 10:34am UTC](https://forum.servoy.com/t/search-on-date-without-time/6681/1 "2006-11-02T10:34:33Z")

</div>

Hello,  
I would like to search a record by his date, without use his hours, minute or second.

I know I can use ‘#’ symbol :

for example: #30/10/06 in the field and it work It return all record create the 30/10/06

But if I use \<= #30/10/06 it return all record in my database and records created the 31/10/06

Thanks,

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [November 2, 2006, 10:43am UTC](https://forum.servoy.com/t/search-on-date-without-time/6681/2 "2006-11-02T10:43:57Z")

</div>

Hi Fabien,

You need to add the dateformat in the searchstring.  
If you check the Servoy help under Getting Started \> Finding Data \> Find dates and times you find the following:

```auto
controller.find();
startDateTime = '#1-1-2004|MM-dd-yyyy';
controller.search();

```

There are also examples in the help for searching data ranges.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![chgog](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@chgog](https://forum.servoy.com/u/chgog)\
**Post date:** [November 2, 2006, 10:50am UTC](https://forum.servoy.com/t/search-on-date-without-time/6681/3 "2006-11-02T10:50:58Z")

</div>

I solved my problem. I change the time of my date and I execute my search method.

```auto
globals.tp_datetime1 = new Date(globals.tp_datetime1.getFullYear(), globals.tp_datetime1.getMonth(), globals.tp_datetime1.getDate(), 23, 59, 59)

date = "<= " + utils.dateFormat(globals.tp_datetime1,'dd/MM/yy HH:mm:ss') + '|dd/MM/yy HH:mm:ss';

```
