I hope someone can give me a hand while I'm learning the ins-and-outs of Informix. I have a table with a bunch of data including dates in Datetime Year to Minute format. I want to run a query and sum it up by date, I'm struggling with it's wonky time formats.
My data looks something similar to
So I'm expecting output like
Instead I'm getting this output
I've tried select distinct date(d_time) and several other ideas but I keep getting lots of rows as it's grouping by those individual times of the day and not the day itself.
I'm sorry but I do not know the exact version of Informix, I have ODBC access to the machine only.
Code:
select date(d_time), sum(somefield)
from my.table
where d_time > datetime(2008-12-01) year to day
group by 1
My data looks something similar to
Code:
2008-12-01 8:01 12
2008-12-01 12:15 7
2008-12-01 14:08 15
2008-12-02 10:50 10
So I'm expecting output like
Code:
2008-12-01 34
2008-12-02 10
Instead I'm getting this output
Code:
2008-12-01 12
2008-12-01 7
2008-12-01 15
2008-12-02 10
I've tried select distinct date(d_time) and several other ideas but I keep getting lots of rows as it's grouping by those individual times of the day and not the day itself.
I'm sorry but I do not know the exact version of Informix, I have ODBC access to the machine only.