Hi all,
I have to add a where clause to a SelectQuery object in which the value specified for the given DbColumn is a java.util.Date filled in with both date and time informations.
But if I use the JdbcEscape enum value 'timestamp' to represent that Date object, it includes milliseconds which are not included neither within the values stored in the database (consequently they don't match) neither within the Date object (in a Date object is not possibile to set milliseconds).
So how can I match values in the database stored in the format:
day-month-year hour:min:sec
with a where clause created with SqlBuilder
(for example:
WHERE date <> {d '2008-12-18 09:22:19'}
rather than WHERE data <> {d '2008-12-18 09:22:19:234'} using timestamp) ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've solved in this way:
indeed of using JdbcEscape, I contruct a string composed by year-month-date hour:min:sec and I add that to the BynaryCondition method (equalTo(), etc.) as it's a common value
so I get:
WHERE (date <> '2008-12-18 9:22:19')
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
I have to add a where clause to a SelectQuery object in which the value specified for the given DbColumn is a java.util.Date filled in with both date and time informations.
But if I use the JdbcEscape enum value 'timestamp' to represent that Date object, it includes milliseconds which are not included neither within the values stored in the database (consequently they don't match) neither within the Date object (in a Date object is not possibile to set milliseconds).
So how can I match values in the database stored in the format:
day-month-year hour:min:sec
with a where clause created with SqlBuilder
(for example:
WHERE date <> {d '2008-12-18 09:22:19'}
rather than WHERE data <> {d '2008-12-18 09:22:19:234'} using timestamp) ?
I've solved in this way:
indeed of using JdbcEscape, I contruct a string composed by year-month-date hour:min:sec and I add that to the BynaryCondition method (equalTo(), etc.) as it's a common value
so I get:
WHERE (date <> '2008-12-18 9:22:19')