On Tuesday, January 7, 2020 at 4:16:44 PM UTC-8, BeeRich33 wrote:
>
> In a related application: date_trunc (this rounds up)
>
> select{[:search_phrase, Sequel.function(:date_trunc(:minute, :
> creation_date)).as(:creation_date), :search_type, :result_count]}.
>
> That field is a timestamp, which I want to round up to the minute. I'm
> thinking it's a PostgreSQL function, so I tried to apply it as above for
> this SQL:
>
> date_trunc('minute', creation_date)
>
> It's not a cast...is it?
>
>
This doesn't appear to be valid Ruby syntax:
:date_trunc(:minute, :creation_date)
For the SQL fragment you gave:
Sequel.function(:date_trunc, 'minute', :creation_date)
or since you are in a virtual row block:
date_trunc('minute', :creation_date)
Thanks,
Jeremy
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sequel-talk/96c0cfe4-c95f-4c46-a839-4ee618d1522d%40googlegroups.com.