Ok. Then unless I'm missing something it would seem that you could get what you wanted but adding an AND to your SQL. Something likeHow you would encapsulate your two dates would depend on the DB field types (i.e., depending on whether your date field is text or date/time)VB Code:
strSQL = "SELECT Expenses.EmpID,Expenses.ExpID, Expenses.Date_Incurred, " strSQL = strSQL & "Expenses.RateID, Rates.Description, Expenses.Mileage, " strSQL = strSQL & "Expenses.Total_Cost " strSQL = strSQL & "FROM Expenses INNER JOIN Rates ON Expenses.RateID = Rates.RateID " strSQL = strSQL & "WHERE EmpID = " & empExp & " strSQL = strSQL & "AND datefield BETWEEN #startdate# AND #enddate# " cmdComm.ActiveConnection = conConnect cmdComm.CommandText = strSQL'etc
PS: I broke your sql statement into different lines simply to make it easier to read in this forum thread. That isn't something you necessarily have to do in your code.




Reply With Quote