I'm trying to execute the following SQL Statement and I'm getting an error message "Invalid column name", but the spelling is ok. So I wondered if it was referring to the data type, as I'm using dates. Do I need to declare the columns 'StartDateTime' & 'EndDateTime' as date variables rather than just strings? If so how do I do this?

SQL:

cmmSQL = "SELECT StartDateTime, EndDateTime, DurationSecs, CallersNumber, DialledNumber,TerminatingNumber, ValuePence FROM Opal_Data WHERE
TerminatingNumber = '" & PRSselecta & "'
AND StartDateTime >= TODATE('" & Starter & "', 'DD/MM/YYYY HH:MM:SS')
AND EndDateTime <= TODATE('" & Ender & "', 'DD/MM/YYYY HH:MM:SS') "

Cheers 'n' Beers....

Skeen.