R
Richard Myers
Hello
My regional settings are UK English. Im looping through a recordset using
some of the values as criteria to run an query in each iteration. My
problem is that Access is interpreting the date differently for no apparent
reason. Below i have the basics of the loop. Note that i haven;t included
full strSql for simplicity
So for example when i run the query where
!MovingTrendStart = 01/01/05
!PeriodStart = 01/04/05
im getting back results only for records that have a date between 1st and
the 4th of Jan 2005. Even though the debug.Print Month statement return 1 &
4 respectively? Whats the deal?
Richard
Do While Not .EOF
......WHERE " & "PeriodStart Between #" &
DateSerial(Year(!movingtrendstart), Month(!movingtrendstart), 1) & "# AND
#" & DateSerial(Year(!periodstart), Month(!periodstart), 1) & "#"
DoCmd.RunSql strSql
Debug.Print Month(!movingtrendstart)
Debug.Print Month(!periodstart)
.MoveNext
Loop
My regional settings are UK English. Im looping through a recordset using
some of the values as criteria to run an query in each iteration. My
problem is that Access is interpreting the date differently for no apparent
reason. Below i have the basics of the loop. Note that i haven;t included
full strSql for simplicity
So for example when i run the query where
!MovingTrendStart = 01/01/05
!PeriodStart = 01/04/05
im getting back results only for records that have a date between 1st and
the 4th of Jan 2005. Even though the debug.Print Month statement return 1 &
4 respectively? Whats the deal?
Richard
Do While Not .EOF
......WHERE " & "PeriodStart Between #" &
DateSerial(Year(!movingtrendstart), Month(!movingtrendstart), 1) & "# AND
#" & DateSerial(Year(!periodstart), Month(!periodstart), 1) & "#"
DoCmd.RunSql strSql
Debug.Print Month(!movingtrendstart)
Debug.Print Month(!periodstart)
.MoveNext
Loop