Guys,
I have been asked to roll back the years and do some development work on botched attempt by one of my previous colleagues to create a Project Management Dashboard...
Anyway I have hit an error today and I can't get past it!
I am submitting a query from
VB in Excel to an Oracle Database as below;
rs.Open "SELECT CUSTOMER_NAME, TO_CHAR(START_DATE), TO_CHAR(END_DATE), PROJECT_MANAGER, HEAD_OF_PROJECTS, PRODUCT, CLARITY_ID, PROJECT_SCOPE, OVERALL_STATUS, CONTRACT, CURRENT_PHASE, PERCENT_COMPLETE, EST_PERCENT_TO_COMPLETE FROM PROJECT, PROJECT_LAYER WHERE PROJECT.PROJECT_ID = PROJECT_LAYER.PROJECT_ID and PROJECT.PROJECT_ID = " + strProject + " and TO_CHAR(LAYER_DATE, 'DD-MON-YY') = " + strReportDate, con
and I am getting the following error;
Run-time error '-214721900 (80040e14)':
[Microsoft][ODBC driver for Oracle][Oracle]ORA-00904: "MAY": invalid identifier
strReportDate is a string and contains '15-MAY-07'
I have tried the code directly against the database via Toad, hardcoding the variables as they are and it works.
Any ideas?
cheers