Andy Matthews wrote:
> How might this query look?
>  
> I feed it a datestart and datend and I would like to get back a list of
> values ordered by military time from 00:00 to 23:00.
>  
> The db is SQL Server 2000. The only way I can think of doing it is to use a
> CASE statement, but that's quite elaborate. Anyone have an idea?

In SQL it looks like this:
SELECT COUNT(*)
FROM table
WHERE bla
GROUP BY
        EXTRACT(YEAR FROM bla),
        EXTRACT(MONTH FROM bla),
        EXTRACT(DAY FROM bla),
        EXTRACT(HOUR FROM bla)

In MS SQL Server 2000 it looks similar, but you need to convert the 
group by to the MS SQL Server idiosyncrasy.

Jochem

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:276041
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to