Re: ORACLE DATE IN WHERE CLAUSE PROBLEMS

From: <James>
Date: 1995/07/10
Message-ID: <1995Jul10.114125.18633_at_newton.ccs.tuns.ca>#1/1


In article <DAz3zr.GJv_at_ddvictor.dundee.ATTGIS.COM> Iain.MacDonald_at_Dundee.NCR.COM (B6138746 ) writes:
>I have a variation on this request:
>
>SELECT or_bdate, count(*)
>FROM orders
>GROUP BY or_bdate;
>
>I had hoped to see a total of orders for each date, but instead I had a huge
>list
>of discrete time 'groups' - anyone overcome this?
>
>Iain MacDonald, WWIS, AT&T GIS (FP&S Scotland)

Yes! Try...

SELECT TO_DATE(or_bdate), count(*)
FROM orders
GROUP BY TO_DATE(or_bdate);

This will convert your date field "or_bdate" from a date/time to strictly a date.

James Richard (JRICHARD_at_TUNS.CA)
"No Assembler Required!" Received on Mon Jul 10 1995 - 00:00:00 CEST

Original text of this message