Please can anyone help. I'm running the following query to find records either 1 week or four weeks earlier. I set the value of i to 7 or 28 accordingly. It runs ok but does not return any results even
"SELECT registerDate, sessionID, RegisterID FROM RegisterHeader WHERE (registerheader.registerDate)= #23/03/2009# ORDER BY registerdate;"
There are records in the table for 23/03/09. I have tried it with and without the # symbols - I don't think I need them but it doesn't work either way.

strsql = "SELECT registerDate, " & _
"sessionID, RegisterID FROM RegisterHeader " & _
"WHERE (registerheader.registerDate)= #" & _
DateAdd("d", -i, [Forms]![registerheader]![regDate]) & _
"# ORDER BY registerdate;"
Set rsprevious = CurrentDb.OpenRecordset(strsql)
setting a watch on strsql returns the following "sessionID, RegisterID FROM RegisterHeader " & _
"WHERE (registerheader.registerDate)= #" & _
DateAdd("d", -i, [Forms]![registerheader]![regDate]) & _
"# ORDER BY registerdate;"
Set rsprevious = CurrentDb.OpenRecordset(strsql)
"SELECT registerDate, sessionID, RegisterID FROM RegisterHeader WHERE (registerheader.registerDate)= #23/03/2009# ORDER BY registerdate;"
There are records in the table for 23/03/09. I have tried it with and without the # symbols - I don't think I need them but it doesn't work either way.