These are chat archives for lucidsoftware/relate

30th
Nov 2017
Drew O'Kane
@drewokane
Nov 30 2017 23:55
hi, I'm having a bit of trouble with dates in a query. I'm attempting to do something like:
val dateFormat = "YYYY-MM-DD HH:mm:ss"
val start = new DateTime(2016, 1, 1, 0, 1, 1).toString(dateFormat)
sql"select * from measurement where end_interval >= $start limit 10"
Gregg Hernandez
@gregghz
Nov 30 2017 23:57
is that a joda date time?
Drew O'Kane
@drewokane
Nov 30 2017 23:57
yes it is
Gregg Hernandez
@gregghz
Nov 30 2017 23:58
there's no interpolator for that
you also don't want to do toString on it like that
do this:
val start = new DateTime(2016, 1, 1, 0, 1, 1)
sql"select * from measurement where end_interval >= ${start.toDate} limit 10"