# Adding an extra ' to a SQL query

**URL:** <https://forum.inductiveautomation.com/t/adding-an-extra-to-a-sql-query/6984>\
**Category:** Ignition\
**Created:** [August 5, 2013, 9:18pm UTC](https://forum.inductiveautomation.com/t/adding-an-extra-to-a-sql-query/6984 "2013-08-05T21:18:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Micky.Franks](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@Micky.Franks](https://forum.inductiveautomation.com/u/Micky.Franks)\
**Post date:** [August 5, 2013, 9:18pm UTC](https://forum.inductiveautomation.com/t/adding-an-extra-to-a-sql-query/6984/1 "2013-08-05T21:18:34Z")

</div>

I have a calendar that picks a date, input for entering in shift begin and end. All of this gets concatenated to a where string. Works fine except I need to add an extra ` around the date/time sof the query doesn’t do arithmetic on the date. I’m having trouble trying to accomplish this.

```auto
 'Where logdatetime between '+ {Root Container.Table.Begin1stShift} + ' and '+ {Root Container.Table.End1stShift} 
```

---

<div class="post-metadata">

**Author:** ![WildeKurt](https://avatars.discourse-cdn.com/v4/letter/w/50afbb/32.png) [@WildeKurt](https://forum.inductiveautomation.com/u/WildeKurt)\
**Post date:** [August 5, 2013, 9:38pm UTC](https://forum.inductiveautomation.com/t/adding-an-extra-to-a-sql-query/6984/2 "2013-08-05T21:38:00Z")

</div>

I’ve found that if I use double quotes all the time except when I need an embedded quote, it works fine. Like this:

“Where logdatetime between '” + {Root Container.Table.Begin1stShift} + “’ and '”+ {Root Container.Table.End1stShift} + “’”

I think you can use the escape character too.
