NZ_Kiwis;10995888 wrote:odbc can't group by date when it's a unix timestamp can it?
Of course it can. Assuming you are dealing with a timestamp expressed in seconds per day, most days are actually represented by 86400 seconds. Thus, each and every such second can be expressed as a date. This works in exactly the same way as a date can be used to group things by day, week, month, year or year-month-day or... Just like a datetime can be used to group things by second, minute, minute:second, week, year etc. What you cannot do is group by seconds using a date since it doesn't contain the information to do so. Ah, well, each date would most likely be converted into the same date with a 00:00:00 time specifier.
All you need to do is convert each time specified by your timestamp to the date that contains the given time.
For example, using MySQL you'd FROM_UNIXTIME(UNIX_TIMESTAMP(), '%Y%m%d'); Your DBMS is likely to provide some kind of conversion functions between unix timestamps and other ways of representing dates, and your DBMS documentation is likely to provide you with the information regarding such conversion functions. Moreover, your DBMS is likely to provide you with alternatives to unsigned integers, such as date or datetime.