Re: Weekly number of trades

From: andrija <andrija.rubelj_at_konzum.hr>
Date: 16 May 2002 05:02:26 -0700
Message-ID: <4bcceb3d.0205160402.2c9063b2_at_posting.google.com>


alex_vlm_at_yahoo.com (Alex) wrote in message news:<ca86b9e9.0205141914.617e0da1_at_posting.google.com>...
> I have to build a 2-dimenshion Chart showing time, number of trades.
> Vertical line would be number of trades
> Horizontal - time
> I have to use number of trades per week as a one point in diagram
> connecting these points into graph which would show trading activity
> over period of time.
>
> # of Trades 100 |
> 80 | *
> 60 | *
> 40 | *
> 20 |
> 0 |_______________________________
> 1st week 2nd week 3d week
>
> Data comes from one table called Trade:
>
> Trade:
> Name Null? Type
> ----------------------------------------- --------
> ----------------------------
> TRADE_ID NOT NULL CHAR(32)
> TRADE_DATE NOT NULL CHAR(10)
> TRADE_QTY NOT NULL NUMBER(15,2)
> TRADE_PRICE NOT NULL NUMBER(15,8)
>
> This query would calculate data for one week:
> select count(*) from trade where trade_date > '2002-05-04' and
> trade_date < '2002-05-12';
>
> How is it possible to get number of trades for each week for period of
> time???
>
> Reporting tool I am going to use for this would be Crystal Reports 8.5
>
> Would very much appreciate your help?

select to_char(trade_date,'IW') week_of_year, count(*) from trade
group by to_char(trade_date,'IW')
order by 1 Received on Thu May 16 2002 - 14:02:26 CEST

Original text of this message