Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Epoch date functions using INFORMIX 10

$
0
0
HELP!

I am having a hard time understanding how to use or convert epoch time into database dates or manipulation thereof. I have records that store the date in integer format. I need to be able to group by the "date" of the epoch number and not include the time. Here is an example of a sql statement.
When I run this query I get the grouping down to the seconds. A possible 86400 results could return per user (one for each second of the day).

How can I group by date only?

$epoch_st_date=1338958800;
$epoch_ed_date=1339477200;

SELECT
TRIM(DECODE(usr[1,3],'OpC','OPC','USER')),
create_date
FROM
t1
WHERE
create_date >= $epoch_st_date
AND
create_date < $epoch_ed_date
group by 1, 2
order by 1, 2

Viewing all articles
Browse latest Browse all 13329

Trending Articles