You can use the Oracle TO_DATE function.
WHERE someDateColumn <= TO_DATE(c
For C # date (see custom date and time strings ):
DateTime.Now.ToString("yyyy/MM/dd")
If you want to add hours / minutes / seconds, you can change accordingly.
edit - Actually, since you mentioned everything, not just the date, I will add. :)
WHERE someDateColumn <= TO_DATE(c
At home, so I canβt start it, but it should work.
To build a line with a where clause, you must do the following:
string someQuery = "SELECT * FROM aTable WHERE someDateColumn <= TO_DATE('" + DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") + "', 'YYYY/MM/DD')"
If you want to use a specific date, not DateTime.Now, just put a variable in its place that holds it there.
source share