Subject | Re: [firebird-support] Problem with timestamp grouping |
---|---|
Author | Helen Borrie |
Post date | 2004-11-22T00:00:04Z |
At 12:27 AM 22/11/2004 +0100, you wrote:
implicitly or explicitly. But I doubt that FLOOR() is the right kind of
criterion for what you want, anyway.
SELECT cast (CreatDate as DATE) as Date1, sum(Price) as sum1
FROM invoices
GROUP BY 1
./heLen
>Hello,It is not possible to cast a timestamp to DOUBLE PRECISION, either
>
>I an trying to group timestamp to whole days like this:
>
>SELECT floor(CreatDate) as Date1, sum(Price) as sum1
>FROM invoices
>GROUP BY floor(CreatDate)
>
>where CreatDate is timestamp
>
>but it throws error:
>
>
>ISC ERROR CODE:335544334
>
>ISC ERROR MESSAGE:
>conversion error from string "2004-01-26 09:02:09.0000"
>
>
>I tried also
>
>GROUP BY floor(CAST (CreatDate as timestamp))
>GROUP BY floor(CAST (CreatDate as double precision))
>
>but the same result.
implicitly or explicitly. But I doubt that FLOOR() is the right kind of
criterion for what you want, anyway.
SELECT cast (CreatDate as DATE) as Date1, sum(Price) as sum1
FROM invoices
GROUP BY 1
./heLen