Query string issue with Microsoft access.

  • Thread starter Stewart Saathoff
  • Start date
S

Stewart Saathoff

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.
 
P

Paul Clement

¤ 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 ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top