SQL Date query in Excel VBA
Hi,
I want to retrieve data into Excel using SQL executed from VBA. The SQL works fine until I try WHERE date > this date.
The date code I tried is this below but I can't get it to work and don't if I should be using ' # " or to_char function. Can anyone help it is driving me bananas!
"SELECT MEMBER.MEMBER_NO, to_char(MEMBER_NOTES.NOTE_DATE, 'mm/dd/yyyy') as NOTEDATE FROM MEMBER INNER JOIN MEMBER_NOTES ON MEMBER_NOTES.MEMBER_NO = MEMBER.MEMBER_NO WHERE TO_CHAR(MEMBER_NOTES.NOTE_DATE, '#MM/DD/YYYY#') > TO_DATE(#04/04/2006#, 'MM/DD/YYYY')"
Any assistance greatly appreciated.
Lane
|