This is becoming quite the hack now, there's actually no way to get the long value of a TIMESTAMP column?
I was playing around with the idea of building it in the SQL call, i.e SELECT (YEAR(ts)-1970)*31536000730)+(DAYOFYEAR(ts)*86400002)+ [... etc...etc..., you see where i'm going with this] as timestamp_long_value However, I'm not completely positive that this is going to be accurate to the millisecond - which I need it to be. Any suggestions? The next solution is hacking H2 and adding EPOCH to the time functions, but i'd rather not branch off of trunk. And that I'm actually considering writing that query above instead of using some other db is a testament to how much I love H2 :) On Sep 17, 10:48 am, brianstarke <[EMAIL PROTECTED]> wrote: > Hey, quick (and maybe stupid) question.... > > If I'm running something like the following query : > > SELECT count(fr.*) as count , fr.id , (fr.ts/2)*2 as start_timestamp > FROM fraa2 fr > INNER JOIN tag_temp tt ON fr.id = tt.id > WHERE fr.ts < '2008-09-17 09:56:01.65' AND fr.ts > '1969-12-31 > 19:00:00.0' > GROUP BY fr.id, start_timestamp > > It's not able to deal with the ts column as a long to do the math I > want. Is there a way to cast TIMESTAMP columns to something that I > can perform this on? I tried CAST and CONVERT functions already :) > > Thanks! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/h2-database?hl=en -~----------~----~----~----~------~----~------~--~---
