I'm sure I have a few issues in this statement, but I believe my main issue comes from where my "LIKE" statement resides.
I'm using parameters in VB 6 -- hence my post to this forum and not the database forum. Apologies if that assumption is wrong.
Anyway, here's what I have and it's not currently working.
It returns Incorrect syntax near '@P3'Code:strSQL = "SELECT PROD.CSU_Clinic_Info.Clinic_Date, PROD.CSU_Clinic_Info.SID_DOC_NUM, " & _ "PROD.CSU_Clinic_Info.Day_Of_Week, PROD.CSU_Clinic_Info.ID " & _ "FROM PROD.CSU_Clinic_Info " & _ "WHERE (PROD.CSU_Clinic_Info.Clinic_Date >= ? " & _ "AND PROD.CSU_Clinic_Info.Clinic_Date <= ?) " & _ "AND PROD.CSU_Clinic_Info.Id Like %? " & _ "AND LEN(PROD.CSU_Clinic_Info.ID) = Len(?) " & _ "AND PROD.CSU_Clinic_Info.Day_Of_Week = ? " & _ "AND PROD.CSU_Clinic_Info.Cancelled <> 'Y' " & _ "AND PROD.CSU_Clinic_Info.Institution = ? " & _ "ORDER BY CLINIC_DATE ASC"




Reply With Quote