[MonetDB-users] converting strings to dates?
Fabian.Groffen at cwi.nl
Tue Dec 4 09:24:07 CET 2007
On 03-12-2007 16:29:35 -0700, m h wrote:
> In Oracle I can do the following:
> select *
> from table
> where timestampcol BETWEEN to_date('01/01/07', 'MM/DD/RR') AND
> to_date('12/31'/07'), 'MM/DD/RR')
> It's not clear that this is possible in monetdb.
> There's the EXTRACT function which pulls a numeric value (month, day
> or year) from a string representing a timestamp, but I can't see how
> to get a timestamp/date object out?
Given you do a BETWEEN it looks like you want numeric values, so
something like EXTRACT epoch FROM sometimestamp. I believe we could
also compare timestamps so maybe BETWEEN just works here.
You can "cast" strings to a time/date/timestamp by using SQL99 notation
timestamp '2007-12-04 09:22:02'
More information about the users-list