I have an access 2000 database with a few tables in it. The I wrote the sql statement below to access two tables. I am not sure if the statement is correct. I know it doesn't work. I have a table of hours with a dataID field that relates to a table called dates which also has a field called dateID, it also has a field called Date which contains the actual dates (ie MM/DD/YYYY). What I want to do is create an sql statement that will return all the records in the Hours table that fall between certain dates in other words all the dates including the starting and ending points.
Note: the sql statement below is formated for VB6 (I am not sure if that makes a difference?)
================================
sql = "SELECT Hours.*,Dates.* FROM Hours,Dates WHERE ((hours.DateID = Dates.DateID) AND (Dates.Date) Between #" & CDate(startTime) & "# And #" & CDate(endTime) & "#)"
=================================
The statement generates no errors but it selects the first record in the database (outside of the range I would like).
Any help would be appreciated....
Troy Williams B.Eng.
fenris@hotmail.com
Note: the sql statement below is formated for VB6 (I am not sure if that makes a difference?)
================================
sql = "SELECT Hours.*,Dates.* FROM Hours,Dates WHERE ((hours.DateID = Dates.DateID) AND (Dates.Date) Between #" & CDate(startTime) & "# And #" & CDate(endTime) & "#)"
=================================
The statement generates no errors but it selects the first record in the database (outside of the range I would like).
Any help would be appreciated....
Troy Williams B.Eng.
fenris@hotmail.com