Exposed
Exposed copied to clipboard
Cannot use eq() with year() ?
Hi I'm trying to select events where date.year() is 2022 for example, but I can't find how.
This works :
val yr = "2022"
query.andWhere { ReadingEventTable.modificationDate.year().between(yr, yr) }
This works :
val yr = "2022"
query.andWhere { ReadingEventTable.modificationDate.year().lessEq(yr) }
But obviously it does not only fetch 2022
This does not work and I can't find a way to do it :
val yr = "2022"
query.andWhere { ReadingEventTable.modificationDate.year().eq(yr) }
IDE says :
Type mismatch.Required:
Op<Boolean>
Found:
Unit
With ReadingEventTable like this :
object ReadingEventTable : UUIDTable("reading_event") {
val creationDate = timestamp("creation_date")
val modificationDate = timestamp("modification_date")
}