Hi all,
I am trying to query using a list and a variable. However, I cannot figure out how to query the dateNow variable. I keep on getting this error:
Error occurred while trying to execute a query: [SQLState 42601] ERROR: syntax error at or near "00"
LINE 4: and test_date_time between 03/12/2024 00:00:00 AM and 03/12/...
Here is my sample script:
namecol= {"James", "John", "Anna", "Rose")
dateNow = "03/12/2024"
eval(parse(evalinsert("\[
dt_qst = Try ( Open Database( "DSN=dbs;UID=uname;PWD=pw;APP=JMP;DATABASE=db;",
"select name, age, address, test_date_time
from db
where name in (^namecol^)
and test_date_time between ^dateNow^ 00:00:00 AM and ^dateNow^ 11:59:59 PM'",
"rawdata") )
]\")));;