Subject Re: [firebird-support] Finding out dates from set of timestamp
Author Helen Borrie
At 12:27 AM 18/03/2009, you wrote:
>Hi,
>
> Is there query to do following without going thru all the records in the table:
>
>select extract(YEAR FROM FIELD_TIMESTAMP),
>extract(MONTH FROM FIELD_TIMESTAMP),
>extract(DAY FROM FIELD_TIMESTAMP) from MYTABLE
>group by extract(YEAR FROM FIELD_TIMESTAMP),
>extract(MONTH FROM FIELD_TIMESTAMP),
>extract(DAY FROM FIELD_TIMESTAMP)
>
> So basically I need all the dates in the table, omitting the time
>part of timestamp.
>
> I'm using Firebird 1.5 in this.

select cast (field_timestamp as date),
..., ...
group by 1

./hb




>------------------------------------
>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>Visit http://www.firebirdsql.org and click the Resources item
>on the main (top) menu. Try Knowledgebase and FAQ links !
>
>Also search the knowledgebases at http://www.ibphoenix.com
>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>Yahoo! Groups Links
>
>
>