473,396 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to use a SQL view as a data source for Excel file

Hello, all!
I need help. There is a "view" in a SQL Server 7 database that contains all the data I need.

I want to create an Excel file (version Excel 2000). I want the file to open the view and refresh the data every time. (The view pulls records for the past 3 months.)

I've tried the Excel menu option "Data | Get External Data | New Database Query" to select the view from the list of database objects. A message appears and the Excel spreadsheet is populated with records. I then saved the .xls file.

PROBLEM: The data isn't refreshed everytime I open the .xls file. It still contains "old" data.

What do I need to do to let Excel know to re-pull the view/query every time the .xls file is opened? (The versions of SQL Server and Excel are "old", but I can't do anything about that at this time.)

Any ideas? (Think of simple things--I have a new computer and the IT dept. may not have installed all the add-ins, etc. that I need for this task.)
Apr 17 '07 #1
2 4978
iburyak
1,017 Expert 512MB
I am not an Excel specialist you probably need to refer your question to another forum like Access.

To pool data for last 3 months you need to use where condition like this:

Expand|Select|Wrap|Line Numbers
  1. Where date_column between dateadd(m, -3, getdate()) and getdate()
Good Luck.
Apr 17 '07 #2
Thanks for the reply!

I created the existing "view" on the SQL Server database with a date function similar to your example. This "view" is being used for several different purposes. I want to use Excel because of it's cool functions, graph capabilities, and easy-to-use filters and such.

I'll post this request on the Access forum as you suggested...
Apr 17 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Chris | last post by:
Could someone please provide me an effective means of exporting data from a data set (or data grid) to Excel?
1
by: Dianna K | last post by:
I am opening, reading and extracting an Excel spreadsheet in .Net (VB). It seems to work fine, however, when I am finished and I open up Excel and try to open up the file a message pops up "File Now...
0
by: Tim Brooks | last post by:
All, I'm hoping one of you Xml or Data gurus can offer an opinion. I'm working on an app to basically compare two semi-structured data files (e.g. Excel / CSV) to one another. But I need to...
1
by: Grey | last post by:
I have created a asp.net form for user to input data. After input the data, user need to click a button to export the input data to excel for data analysis with excel pivot table function. is it...
9
by: harborboy76 | last post by:
Hi, I have a problem with one of my view. Basically, I need to create a view to sum the amount in Table A grouped by the EMPLOYEE_ID. But I also need the ability to limit the date range. What...
5
by: cjl | last post by:
Hi. I am trying to screen scrape some stock data from yahoo, so I am trying to use urllib2 to retrieve the html and beautiful soup for the parsing. Maybe (most likely) I am doing something...
1
by: cckelly | last post by:
I originally posted this problem on the SQL Server forum. I received a reply from a definite non-newbie instructing me to post my question to this Access forum. SO, here goes... ---- Hello, all!...
8
by: Bruce_Stough | last post by:
I am currently using Control.DoDragDrop to drop a text string into Excel. I use the following code DataObject dd = new DataObject();...
6
by: slinky | last post by:
I found the following code to transfer datagrid data to an Excel file. Is this written in C#?... I'm a vb.netter. I'm just not sure where to place the code to experiment on it. Should I place it in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.