Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking Excel and SQL Server 2

Status
Not open for further replies.

jgurgen

Programmer
Mar 9, 2006
192
US
I have an excel spreadsheet which contains data that we had exported a few months ago. We cant export the report again since it was a snap shot in time at that moment but we wanted to add a state field to each loan in the report. THe loanids are in the A column. We have the Q column open to put the state in. the states are kept in Property.State

How can i run pull the state in for each loan that is in the report and put it in column Q?
 




Hi,

I'm not getting a clear picture of what you have in your workbook.

1. A report sheet that has a list of LoanID's in Column A

2. A query sheet that has, what the Property.State and the LoanID? Then it need to be LoanID, State in columns A & B respectively to work.

3. You want to get that Property.State into the report sheet in Column Q for each corresponding LoanID.

If that summary is correct, then, assuming that your DATA begins in row 2, a formula like this would work in column Q...
[tt][highlight white]
=vlookup(A2, QuerySheet!Query_From_SQL_Server,2,false)
[/highlight][/tt]
where QuerySheet is the sheet name containing the query and
Query_From_SQL_Server is the QueryTable range name of your query.



Skip,

[glasses] [red][/red]
[tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top