I have created a Excel file with several worksheets. The worksheets hold a pivot table and uses a ODBC connection to our SQL db to pull data. The SQL relies on 2 variables for a Start and End date. Currently, I need to open the file and go to the Connections and edit each SQL query in the Connection Properties.
Since my boss is doing this (and have to convert dates to Epoch time) I would love to find a easy way to add the dates in each sheet (or in a new sheet) and pass those dates down to the query.
quote:declare @StartDate bigint, @EndDate bigint
set @StartDate = 1412827200;
set @EndDate = 1414641599
If I have the dates on a sheet named Dates and in cells A1 and A2 I have the start and end dates - how can I set the variables above to the values in A1:A2?
I would rather not use VBA if at all possible. I know I can use a select to set variables but the examples I have tried has not worked.... Maybe a limitation of Excel?
Thanks,
--
Brian
"It drops into your stomach like a Abrams's tank.... driven by Rosanne Barr..." A. Bourdain
↧