# searching for date omitting time portion

**URL:** <https://forum.servoy.com/t/searching-for-date-omitting-time-portion/7765>\
**Category:** Classic Servoy\
**Created:** [July 3, 2007, 2:12pm UTC](https://forum.servoy.com/t/searching-for-date-omitting-time-portion/7765 "2007-07-03T14:12:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![faheemhameed](https://avatars.discourse-cdn.com/v4/letter/f/7ea924/32.png) [@faheemhameed](https://forum.servoy.com/u/faheemhameed)\
**Post date:** [July 3, 2007, 2:12pm UTC](https://forum.servoy.com/t/searching-for-date-omitting-time-portion/7765/1 "2007-07-03T14:12:20Z")

</div>

I have a date field. I use the string “#01-07-2007…03-07-2007|dd-MM-yyyy” to do the find. I want to find the date range but omit the time from the date range. But it returns no records.

If I use “#” for single date search then it works perfectly. “#03-07-2007|dd-MM-yyyy”

Please help!

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [July 3, 2007, 3:04pm UTC](https://forum.servoy.com/t/searching-for-date-omitting-time-portion/7765/2 "2007-07-03T15:04:02Z")

</div>

Haven’t tried, but what happens if you do

```auto
"01-07-2007...03-07-2007|dd-MM-yyyy"

```

Couldn’t you also use

```auto
"01-07-2007 00:00:00...03-07-2007 23:59:59|dd-MM-yyyy HH:mm:ss"

```

---

<div class="post-metadata">

**Author:** ![rafig](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/rafig/32/4463_2.png) [@rafig](https://forum.servoy.com/u/rafig)\
**Post date:** [July 4, 2007, 1:30pm UTC](https://forum.servoy.com/t/searching-for-date-omitting-time-portion/7765/3 "2007-07-04T13:30:13Z")

</div>

Hi,  
don’t use ‘#’ on a date range search (it’s just for single date search to ignore time). The range ignores the times & does 0:00:000 to 23:59.999 (or whatever…). you might need the | bit though, although if you have the pref. set for the date format and just use that in a range, it should work fine.

---

<div class="post-metadata">

**Author:** ![faheemhameed](https://avatars.discourse-cdn.com/v4/letter/f/7ea924/32.png) [@faheemhameed](https://forum.servoy.com/u/faheemhameed)\
**Post date:** [July 5, 2007, 2:51am UTC](https://forum.servoy.com/t/searching-for-date-omitting-time-portion/7765/4 "2007-07-05T02:51:04Z")

</div>

Thanks for your answer guys.

I am not sure why I posted this post. What rafig saying is actually working for me now.

Thanks!

---

<div class="post-metadata">

**Author:** ![antonio](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@antonio](https://forum.servoy.com/u/antonio)\
**Post date:** [August 20, 2007, 5:52am UTC](https://forum.servoy.com/t/searching-for-date-omitting-time-portion/7765/5 "2007-08-20T05:52:00Z")

</div>

I have the same problem, but not all the time. If I search ServiceDate with

```auto
"19-08-2007...20-08-2007|dd-MM-yyyy"

```

I get no records, but if I expand the search to

```auto
"19-08-2007...21-08-2007|dd-MM-yyyy"

```

I get 3 records with a ServiceDate of 20-08-2007.  
I’m stumped.

---

<div class="post-metadata">

**Author:** ![faheemhameed](https://avatars.discourse-cdn.com/v4/letter/f/7ea924/32.png) [@faheemhameed](https://forum.servoy.com/u/faheemhameed)\
**Post date:** [August 20, 2007, 7:46am UTC](https://forum.servoy.com/t/searching-for-date-omitting-time-portion/7765/6 "2007-08-20T07:46:20Z")

</div>

as patrick said you can try this:

19-08-2007…20-08-2007

```auto
"19-08-2007 00:00:00...20-08-2007 23:59:59|dd-MM-yyyy HH:mm:ss"

```

There seems to be values in the time portion of the date 20-08-2007. So you may try the above.

---

<div class="post-metadata">

**Author:** ![antonio](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@antonio](https://forum.servoy.com/u/antonio)\
**Post date:** [August 20, 2007, 7:58am UTC](https://forum.servoy.com/t/searching-for-date-omitting-time-portion/7765/7 "2007-08-20T07:58:29Z")

</div>

Yep, you’re right, that does find the records. Thanks, missed that before. There’s the suggestion from rafig that a date range search ignores the time portion. This is the impression from the help files too.
