I notice in your query you have coded "b.VisitDate > 12/31/1998". Wouldn't "12/31/1998" in that context be interpreted as two division operations, yielding a very small number (about .0001937)?
I don't know much about current ANSI standard SQL. My old ANSI SQL reference doesn't even include a date data type. Could it be that there isn't one? How does the visit date come to be stored in the database? Most DBMSs (Access for instance) encode a date as a floating point number giving the number of days since a particular base date, but the base date depends on the DBMS. Whatever DBMS is storing this date, you have to understand what its base date is, as well as the base date for the system you're writing SQL for. And you might have to convert between them in order to avoid comparing apples and oranges. Rick Sprague