Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC call failed on evaulation of field

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I'm having trouble getting a query to work while linked to MS SQL Server 7.0 tables from MS Access 2000. I get an ODB -- Call Failed after I'm prompted for the Parameters. Could it be that the evaluation of the 'between' statements in the WHERE clause are not be evaluated properly or at all? The query is as follows:

============ Start Query ============
PARAMETERS [Beginning Date or leave blank for all] DateTime, [Ending Date or leave blank for all] DateTime, [Enter Staff Number or leave blank for All] Long;
SELECT DISTINCTROW CALENDAR.CASETICKLE, CALENDAR.CalDATE, CALENDAR.CTIME, CALENDAR.SNUM, CALENDAR.CASENUM, CALENDAR.RTICKLE, CALENDAR.REASON, CLIENTSW.CLNAME, CLIENTSW.CFNAME, CLIENTSW.CPHONE, subRTICKLE.RTICREA, CLIENTSW.DOPEN, CLIENTSW.CASETYPE, SMEMBER.SINITIALS
FROM subRTICKLE RIGHT JOIN (SMEMBER RIGHT JOIN (CLIENTSW RIGHT JOIN CALENDAR ON CLIENTSW.CASENUM = CALENDAR.CASENUM) ON SMEMBER.SNUM = CALENDAR.SNUM) ON subRTICKLE.RTickle = CALENDAR.RTICKLE
WHERE (((CALENDAR.CalDATE) Between [Beginning Date or leave blank for all] And [Ending Date or leave blank for all]) AND ((CALENDAR.SNUM)=[Enter Staff Number or leave blank for All])) OR (((CALENDAR.CalDATE) Between [Beginning Date or leave blank for all] And [Ending Date or leave blank for all]) AND (([Enter Staff Number or leave blank for all]) Is Null)) OR (((CALENDAR.SNUM)=[Enter Staff Number or leave blank for All]) AND (([CALENDAR].[CalDATE] Between [Beginning Date or leave blank for all] And [Ending Date or leave blank for all]) Is Null)) OR ((([Enter Staff Number or leave blank for all]) Is Null) AND (([CALENDAR].[CalDATE] Between [Beginning Date or leave blank for all] And [Ending Date or leave blank for all]) Is Null))
ORDER BY CALENDAR.CalDATE, CALENDAR.CTIME, CALENDAR.SNUM;

============ End Query ============


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top