I need help if it is possible where I can upload SQL query in excel via Get Data>From Database>From SQL Server Database, and be able to change the date in this uploaded SQL query.
My hope is to use three cells within tab where i enter a date, and either use a vba or SQL looks cell value automatically and provide results when i refresh SQL.
Right now i have these sets of dates.
set @eomdate = '2022-10-31'
set @startdate = '2016-01-01'
set @enddate = '2022-10-31'
I want to use cells in excel that lookup date entered in cell A1, B1, and C1. My goal is to change the dates to get results based on dates entered.
set @eomdate = Sheet1A1
set @startdate = Sheet1B1
set @enddate = Sheet1C1
is there a way to use a VBA code that will change the dates based on cells mentioned above? I am researching but have been unlucky.
Private Sub CommandButton1_Click()
Dim ws As Worksheet
Set ws = Worksheets("Query1")
ActiveWorkbook.RefreshAll
End Sub
Any help is greatly appreciated.
Thank you,
Kosta
My hope is to use three cells within tab where i enter a date, and either use a vba or SQL looks cell value automatically and provide results when i refresh SQL.
Right now i have these sets of dates.
set @eomdate = '2022-10-31'
set @startdate = '2016-01-01'
set @enddate = '2022-10-31'
I want to use cells in excel that lookup date entered in cell A1, B1, and C1. My goal is to change the dates to get results based on dates entered.
set @eomdate = Sheet1A1
set @startdate = Sheet1B1
set @enddate = Sheet1C1
is there a way to use a VBA code that will change the dates based on cells mentioned above? I am researching but have been unlucky.
Private Sub CommandButton1_Click()
Dim ws As Worksheet
Set ws = Worksheets("Query1")
ActiveWorkbook.RefreshAll
End Sub
Any help is greatly appreciated.
Thank you,
Kosta