Hello Everyone,

I am having an unusual problem. I have this string that I am using as the
Select Command for an Access database:

SELECT time.employee, time.timein, time.timeout, time.ichkalt, time.ochkalt,
time.realin, time.realout, employees.FName, time.iDate, time.oDate, FROM
departments INNER JOIN (employees INNER JOIN [time] ON
employees.employeeid=time.employee) ON
departments.departmentid=employees.departmentid WHERE ((time.oDate) <= " & o
& " ) And ((employees.employeeid)= " & eid & " ) AND ((time.iDate)>= " & i &
" )

The i, o, and eid variables have been declared already. The result set
works when you remove the 'oDate <=" & o & " )' part of the statement. When
you run the query without that criteria, the result set is returned
correctly. When you add that criteria to the string, no results are
returned, even when I am inserting correct information. Does anyone have a
clue as to what to do?

Thanks in advance.

Re: Query string issue with Microsoft access. by Paul

Paul
Wed Feb 04 09:54:56 CST 2004

On Tue, 3 Feb 2004 15:40:47 -0600, "Stewart Saathoff" <stewarts@complete-networking.com> wrote:

¤ Hello Everyone,
¤
¤ I am having an unusual problem. I have this string that I am using as the
¤ Select Command for an Access database:
¤
¤ SELECT time.employee, time.timein, time.timeout, time.ichkalt, time.ochkalt,
¤ time.realin, time.realout, employees.FName, time.iDate, time.oDate, FROM
¤ departments INNER JOIN (employees INNER JOIN [time] ON
¤ employees.employeeid=time.employee) ON
¤ departments.departmentid=employees.departmentid WHERE ((time.oDate) <= " & o
¤ & " ) And ((employees.employeeid)= " & eid & " ) AND ((time.iDate)>= " & i &
¤ " )
¤
¤ The i, o, and eid variables have been declared already. The result set
¤ works when you remove the 'oDate <=" & o & " )' part of the statement. When
¤ you run the query without that criteria, the result set is returned
¤ correctly. When you add that criteria to the string, no results are
¤ returned, even when I am inserting correct information. Does anyone have a
¤ clue as to what to do?
¤

Does it work properly if you enclose the date criteria within pound signs (e.g. #9/21/1992#)?


Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)