Quote Originally Posted by sujitshukla View Post
Thanks guys for the code...The code works perfectly fine.
My only query here is .I will provide the user with some options in excel sheet such as data validation.

So he will
Select a Start date in Cell A1 of Excel Sheet1.
Select a End date in Cell A2 of Excel Sheet1.
Select a Location in Cell A3 of Excel Sheet1.

My Query should pull data based on the above.

Logic wise i am clear . Putting this in VBA is kind of difficult for me.

Thanks once again
As you say you are clear on the logic I presume that you are having problems getting the cell values into the SELECT statement.

set wks=worksheets("sheet1")
"SELECT * FROM tbl_name where startdate>='" & wks.range("A1") & "' and enddate<='" & wks.range("A2") & "' and Location = """ & wks.range("A3") & """;"