As this is my first post, I'll do a brief introduction about myself
I'm currently studying in Malaysia for my IT diploma certificate. Curently, I'm trying to complete a year-end software development project and am stuck with an sql query statement. I did a search through the previous posts in this forum for a solution but couldn't manage to find a way to solve it.
Here's the situation. There are two tables; bookingfile and schedulefile. I need to select a field, ScheduleNo, in the schedulefile, which will be on a certain date.
Then select a few fields which have the same corresponding ScheduleNo in the bookingfile table.
Here's the current query:
strsql = "SELECT ScheduleNo, BusNo FROM BookingFile WHERE ScheduleNo IN" _
& "(SELECT ScheduleNo FROM ScheduleFile WHERE Day(EstimatedDepartureDate) = '" & query_date & "' AND Month(EstimatedDepartureDate) = '" & query_month & "' " _
& " AND Year(EstimatedDepartureDate) = '" & query_year & "')"
The inner select seems to be working because I'm getting getting the appropriate schedule numbers from the dates specified. But when combined witht outer select, it gave out this error: " Invalid Memo, OLE, or Hyperlink Object in subquery 'ScheduleNo'. "
The database file used is access.
I would greatly appreciate any help from you guys. Thanks.