Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
cdogstu99
Starting Member
1 Post |
Posted - 2011-02-16 : 14:47:41
|
| I have a list of data for stocks. I have created a screen to find stocks based on my criteria. I would like to get the results for my screen for the end of every month for the past two years. For example: I would like the ouptup of my screen on Jan 31, 2010, Feb 28 2010, etc.Currently my query looks something like this:Select Ticker, Name, MarketCap, GrowthRateFrom MyDatabaseWhere Date='12/31/10'And GrowthRate>10order by GrowthRate descIs there any way to get all of the data i need easily in one query for the last 24 months? So that i will have a table with 24 dates and a list of tickers for each of those dates?Thanks! |
|
|
RobertKaucher
Posting Yak Master
169 Posts |
Posted - 2011-02-16 : 15:20:35
|
| [CODE]WHERE DateField IN('20110131', '20101231') AND GrowthRate > 10ORDER BY GrowthRate DESC[/CODE]The problem being the list is now hard coded...===http://www.ElementalSQL.com/ |
 |
|
|
|
|
|