How to query over sql with Date-Time?

0
Hello,  i would like to make a sql query: -- 'SELECT Linie_ID,IOStueckzahl,NIOStueckzahl,Time FROM TraceLinien  WHERE Linie_ID = '+$LinienID_Var+' AND  Schichtnummer = '+$IntSchicht_Var+' AND Time <= '+$Variable+';' -- $Variable = ‘2021-07-14’ i try it also with $Variable = ‘2021-07-14 23:00:00’ The sql table with the Name “Time” has an DateTime Format. Can anyone help me?
asked
4 answers
1

I tried everything the last hours, but nothing is working. 

But know a team member found a solution. 

I have to write the Date as a String with two aposthrope. 

it also works with the time. You have to write:

Thank you for your help!

answered
0

Now, I understood your question, you should actually use 

Time <= TO_DATE($Variable', 'YYYY-MM-DD')   here use whatever the format is there in your variable

answered
0

Here is a picture from it. “Time” is the name of the column from a sql table. 

 

The SQL Table

answered
0

There is no function “to_date” only a function named “parseDateTime” .

I found this description: 

But in my case, there is an error, listed below.

answered