# SQL todays date

**URL:** <https://forum.inductiveautomation.com/t/sql-todays-date/7690>\
**Category:** General Discussion\
**Created:** [December 11, 2013, 6:46pm UTC](https://forum.inductiveautomation.com/t/sql-todays-date/7690 "2013-12-11T18:46:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cja7928](https://avatars.discourse-cdn.com/v4/letter/c/258eb7/32.png) [@cja7928](https://forum.inductiveautomation.com/u/cja7928)\
**Post date:** [December 11, 2013, 6:46pm UTC](https://forum.inductiveautomation.com/t/sql-todays-date/7690/1 "2013-12-11T18:46:50Z")

</div>

trying to return columns with todays date and so far nothing ive found on any of the tutorials ive been reading seems to work…

any ideas on either of these methods on what im doing wrong?

```auto
WHERE DATE_DT BETWEEN '2013-12-11 00:00:00' AND '2013-12-11 23:59:59'
```

or

```auto
WHERE CONVERT(VARCHAR(10), DATE_DT, 101) = CONVERT(VARCHAR(10), GETDATE(), 101)
```

thanks.

---

<div class="post-metadata">

**Author:** ![cja7928](https://avatars.discourse-cdn.com/v4/letter/c/258eb7/32.png) [@cja7928](https://forum.inductiveautomation.com/u/cja7928)\
**Post date:** [December 11, 2013, 9:45pm UTC](https://forum.inductiveautomation.com/t/sql-todays-date/7690/2 "2013-12-11T21:45:37Z")

</div>

also when I try:

`WHERE
   t_stamp >= '2010-03-20 08:00:00' AND
   t_stamp <= '2010-03-20 13:00:00'`

straight out of the book I get: ORA-01861 literal does not match format string

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [December 11, 2013, 10:02pm UTC](https://forum.inductiveautomation.com/t/sql-todays-date/7690/3 "2013-12-11T22:02:49Z")

</div>

The examples that you see are for MySQL and SQL Server, not for Oracle.

For Oracle you probably need to use the TO\_DATE function.

Examples here: [stackoverflow.com/questions/2369 … ween-query](http://stackoverflow.com/questions/2369222/oracle-date-between-query)

---

<div class="post-metadata">

**Author:** ![cja7928](https://avatars.discourse-cdn.com/v4/letter/c/258eb7/32.png) [@cja7928](https://forum.inductiveautomation.com/u/cja7928)\
**Post date:** [December 12, 2013, 2:32am UTC](https://forum.inductiveautomation.com/t/sql-todays-date/7690/4 "2013-12-12T02:32:23Z")

</div>

thank you that sent me in the right direction.
