# system.db.runPrepQuery

**URL:** <https://forum.inductiveautomation.com/t/system-db-runprepquery/18814>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [July 13, 2018, 3:50pm UTC](https://forum.inductiveautomation.com/t/system-db-runprepquery/18814 "2018-07-13T15:50:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LopezSilvanoE](https://avatars.discourse-cdn.com/v4/letter/l/82dd89/32.png) [@LopezSilvanoE](https://forum.inductiveautomation.com/u/LopezSilvanoE)\
**Post date:** [July 13, 2018, 3:50pm UTC](https://forum.inductiveautomation.com/t/system-db-runprepquery/18814/1 "2018-07-13T15:50:56Z")

</div>

Hello … I have a issue when try to run a PrepQuery using system.db.runPrepQuery

This is my scripting…  
####################################################3  
StartDate = ‘2018-07-13 06:00:00.000’  
EndDate = ‘2018-07-13 16:00:00.000’

results = system.db.runPrepQuery(“SELECT \* FROM [paint].[dbo].[paint\_system\_history] WHERE time\_stamp \>= (?) AND time\_stamp \< (?)”,[StartDate] [EndDate])

print results

##########################################################  
But not works  
what is the exactly syntax when the query has multiple placeholders (?)

I hope could help me!!!

Best Regards

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [July 13, 2018, 3:55pm UTC](https://forum.inductiveautomation.com/t/system-db-runprepquery/18814/2 "2018-07-13T15:55:14Z")

</div>

use ``` triple back quotes to enclose your code to format it for the forum. [Syntax here](https://docs.inductiveautomation.com/display/DOC79/system.db.runPrepUpdate)

try this……[StartDate,EndDate]

---

<div class="post-metadata">

**Author:** ![LopezSilvanoE](https://avatars.discourse-cdn.com/v4/letter/l/82dd89/32.png) [@LopezSilvanoE](https://forum.inductiveautomation.com/u/LopezSilvanoE)\
**Post date:** [July 13, 2018, 4:00pm UTC](https://forum.inductiveautomation.com/t/system-db-runprepquery/18814/3 "2018-07-13T16:00:02Z")

</div>

hii dkhayes117… works good thanks for your help and time…

regards
