J
JRough
Can you help me, I'm trying to code this by hand in SQL?
I want to compare the open price from qry1 to the open price from
qryII (next day)
I want to filter the largest 20% drops in price
qryI: filters out stocks greater than $5.00
qryII: gets the next day openPrice from those in qryI
thanks,
Select qry1.exchCD, qryI.permNo, qryI.date, qrtI.ticker, qryI.excCD,
qryI.Bidlo, qryI.AskHi, qrtI.Vol, qry1.Ask, qry1.OpenPrc
INNER JOIN qryII
ON qryI.permNo = qryII.permNo
Where (
SELECT TOP 20 PERCENT qry1.OpenPrc - qryII.OPenPrc)
ORDER BY exchCD, ASC)
Did I do qryIII right by choosing the top 20% and making the sort
Ascending?
thanks,
------------------------
I. qry_I
select exchCD, permNo, date, ticker, excCD, Bidlo, AskHi, Vol, Ask,
OpenPrc
WHERE prc > 5;
II. qry_II
select qryI.exchCD, qryI.permNo, qryI.dateadd(d,1,date), qry1.ticker,
qry1.excCD, qry1.Bidlo, qry1.AskHi, qry1.Vol, qry1.Ask, qry1.OpenPrc ;
I want to compare the open price from qry1 to the open price from
qryII (next day)
I want to filter the largest 20% drops in price
qryI: filters out stocks greater than $5.00
qryII: gets the next day openPrice from those in qryI
thanks,
Select qry1.exchCD, qryI.permNo, qryI.date, qrtI.ticker, qryI.excCD,
qryI.Bidlo, qryI.AskHi, qrtI.Vol, qry1.Ask, qry1.OpenPrc
INNER JOIN qryII
ON qryI.permNo = qryII.permNo
Where (
SELECT TOP 20 PERCENT qry1.OpenPrc - qryII.OPenPrc)
ORDER BY exchCD, ASC)
Did I do qryIII right by choosing the top 20% and making the sort
Ascending?
thanks,
------------------------
I. qry_I
select exchCD, permNo, date, ticker, excCD, Bidlo, AskHi, Vol, Ask,
OpenPrc
WHERE prc > 5;
II. qry_II
select qryI.exchCD, qryI.permNo, qryI.dateadd(d,1,date), qry1.ticker,
qry1.excCD, qry1.Bidlo, qry1.AskHi, qry1.Vol, qry1.Ask, qry1.OpenPrc ;