perdumonocle / sql-builder

Simple SQL code generator.
MIT License
123 stars 13 forks source link

Where Clause With TO_DATE #9

Open IdemenB opened 3 years ago

IdemenB commented 3 years ago

Hi, I've been trying to find the proper input to make a query for some columns where a timestamptz field is less than today.

For the column field DATE() SQL function works properly, but for value what should be the input?

let now: DateTime<Local> = Local::now();
let generated_query = &base_select_statement
                .and_where_le("DATE(duedate)",&("TO_DATE(**?????**)"))

Anyone already took care of this scenario?