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 |
TheJudge
Starting Member
2 Posts |
Posted - 2007-11-11 : 13:21:08
|
Can someone please help?My access database downloads the last 6 months stock market data i.e close, high, low price. However, I want to show the results in Excel but only the last three values for each stock (as I have over 1000 stocks).For example:qDate qTicker qOp qHi qLo qCl qVo08/11/2006 AAT.L 98 100 98 99 236100109/11/2006 AAT.L 98 98 98 98 37800110/11/2006 AAT.L 99 99 97 97 6600108/11/2006 VOD.L 198 100 198 199 236102009/11/2006 VOD.L 198 198 198 198 37802010/11/2006 VOD.L 199 199 197 197 6601008/11/2006 ARM.L 298 200 298 299 123610009/11/2006 ARM.L 298 298 298 298 31780010/11/2006 ARM.L 299 299 297 297 66100but instead it displays the last 6 months data for every stock to the point where it is unable to display anymore records in Excel.Does anyone have any SQL code to resolve this?Thanks! |
|
dataguru1971
Master Smack Fu Yak Hacker
1464 Posts |
Posted - 2007-11-11 : 13:36:25
|
If you are using MS QUery to feed the excel sheet you can add a filter like this on the qDate column>=dateadd(d,-3,getdate()) |
|
|
TheJudge
Starting Member
2 Posts |
Posted - 2007-11-11 : 13:40:58
|
I'm not worried about the 65k limit as I don't need to use it that many rows. I connect to my access database by using excel’s "new database query". I then access the Microsoft Query program where it gives me the option to amend the SQL. |
|
|
dataguru1971
Master Smack Fu Yak Hacker
1464 Posts |
Posted - 2007-11-11 : 13:48:12
|
Try the filter I posted, I changed my response. At first I thought it was not a SQL problem, but as a frequent user of MS Query and the SQL therein, I figured you might gather the data that way.. |
|
|
|
|
|