OK, I have a question about using 2 cells as the parameters for a SQL Statement.
This code is not working because it is not recognizing STARTDATE and ENDDATE as parameters:
Dim STARTDATE As Date
Dim ENDDATE As Date
STARTDATE = Range("B1").Value
ENDDATE = Range("B2").Value
'Write my SQL statement to get any FSR information
Dim sSelectFields As String
Dim sSelectFrom As String
Dim sSelectWhere As String
Dim sSelectGroupBy As String
Dim sSelectHaving As String
Dim sSelectOrderBy As String
sSelectFields = "ServiceDate,CallReportNo,FieldServiceEngineerAssigned,CallTypes,Facility,PhysicianName,FailureType,RepairCodes,ReviewedByDate"
sSelectFrom = "FieldServiceReport"
sSelectWhere = "ServiceDate <> '' AND ServiceDate >= STARTDATE AND ServiceDate <= ENDDATE AND NOT(CallReportNo LIKE '%TEST%') AND NOT(CallReportNo LIKE '%CREU%')"
sSelectGroupBy = ""
sSelectHaving = ""
sSelectOrderBy = "ServiceDate"
Thanks in advance.
-Josh