Currently, I have an Excel sheet in which I input a Start-date and End-date which will go to the VBA code and input it on a SQL query. The problem I am currently having is that I received an error:
ORA-01843 not a valid month because the Excel is importing the date as
05/01/2016and the query needs to be05-may-2016.
How do I change that??
Here is the code for the start and end date:
startDate = Worksheets("Sheet1").Range("B4").Text
endDate = Worksheets("Sheet1").Range("B6").Text
dbConnectStr = "Provider=msdaora;User Id=" & Uname
dbConnectStr1 = "Provider=msdaora;User Id=xxendur ;Data Source=" & DSN
Set Sql.ActiveConnection = objmyconn
Sql.CommandText = "select system_date from syit_act_log where system_date between`enter code here` 'startDate' AND 'endDate' and action_id = 15 and log_desc not like '%svc_openlink_p%' order by system_date"
Sql.CommandType = adCmdText
Sql.Execute
yyyymmdddate format.whereclause should be something like this:where system_date between '20160505' and '20160505'