J
JRough
I want to compare todays opening price with yesterdays opening price
for 3 stock exchanges with an open price of >= $5.00.
First pass query I get all the stocks with a open price of greater
than $5.00 for yesterday:
select myTable.exchCD, myTable.permNo, my.Table.date, myTable.ticker,
myTable.excCD, myTable.Bidlo, myTable.AskHi, myTable.Vol, myTable.Ask,
myTable.OpenPrc
WHERE prc > $5
and date = datepart('d', (today())-1) as qryYesterday;
Second query I compare yesterday with today and get the top 20% of
stocks that dropped in price and are still greater than $5.00 because
I made it DESC sort I can get the top 20 % of those that lost value,
also I need to sort by 3 exchanges.
SELECT TOP 20 PERCENT myTable.exchCD, myTable.permNo, myTable.date,
myTable.ticker, myTable.excCD, myTable.Bidlo, myTable.AskHi,
myTable.Vol, myTable.Ask, myTable.OpenPrc WHERE myTable.openPrc > 5
ORDER BY excCD and myTable.openprc - qryYesterday.openPrc DESC;
thanks.
for 3 stock exchanges with an open price of >= $5.00.
First pass query I get all the stocks with a open price of greater
than $5.00 for yesterday:
select myTable.exchCD, myTable.permNo, my.Table.date, myTable.ticker,
myTable.excCD, myTable.Bidlo, myTable.AskHi, myTable.Vol, myTable.Ask,
myTable.OpenPrc
WHERE prc > $5
and date = datepart('d', (today())-1) as qryYesterday;
Second query I compare yesterday with today and get the top 20% of
stocks that dropped in price and are still greater than $5.00 because
I made it DESC sort I can get the top 20 % of those that lost value,
also I need to sort by 3 exchanges.
SELECT TOP 20 PERCENT myTable.exchCD, myTable.permNo, myTable.date,
myTable.ticker, myTable.excCD, myTable.Bidlo, myTable.AskHi,
myTable.Vol, myTable.Ask, myTable.OpenPrc WHERE myTable.openPrc > 5
ORDER BY excCD and myTable.openprc - qryYesterday.openPrc DESC;
thanks.