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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update SQL Table from Excel

Status
Not open for further replies.

mrliam69

Programmer
Jul 21, 2003
75
0
0
GB
Starting from scratch on this one.
Our production team use a spreadsheet to manipulate data pulled into it from our SQL Server and they then want to send the updated data back to the SQL Server.
Luckily for me it is just the Production Date they want to update.
All they need from the spreadsheet is the production ID and the Date but I am stuck in how to do the SQL statement from Excel.
And I would guess that I would have to do it a row at a time from excel.

server = NRGH1
database = EXH1
table = TBL_ProductionOrders
fields = PRODID and PRODREQDATE

 



Hi,

Assumint that you have update rights to the database, you could use an UPDATE query in MS Query - Data/Get External DAta/New Database Query...

However, it will take VBA, so please report in VBA Visual Basic for Applications (Microsoft) forum707.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 



As a starting point, use MS Query on a new sheet, to enter a simple Select query, and File/Return data to Excel

Turn on the macro recorder and record editing the query and return data to Excel. This will generate the conde containg the Connection string and the CommandText SQL that you just entered. This code will be the basis for your little system. Please post in Formu707.

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

Part and Inventory Search

Sponsor

Back
Top