hi
is it posible to get a data from a sql table linked to an excel spreadsheet
i have a file named minuta, and i have a sql server with a table named facturas where there are sales data registers.
i want to put the sale import taked from a sql table (dbo.facturacion) , where a field named Numdoc is equal to cell value a2
is it posible it?
thanks a lot
1. Include the cell value in A2 in your SQL script.
2. Loop over the "Numdoc" values in your recordset and write the other field values when you find a match.
There are pros and cons to each.
Including the "Numdoc" value from A2 in your script only allows one record to be returned. Not the most effective if you have a lot of "Numdoc" values to look up.
Looping over the "Numdoc" values in your recordset would be more efficient with a lot of "Numdoc" values in your worksheet, but looping over the recordset multiple times is also not very efficient.