"WHERE 1=1" always evaluates to true. Sometimes, when dynamically building a SQL statement with optional WHERE criteria, I will use WHERE 1=1 and then concatenate the other criteria. This may have been done for a similar reason in your example.
Example:
sCrit1="Col2=12"
sCrit2=""
sCrit3="Col5='Denver'"
SQL = "Select * From Table Where 1=1 "
If sCrit1 <> "" Then
SQL = SQL & " And " & sCrit1
End If
If sCrit2 <> "" Then
SQL = SQL & " And " & sCrit2
End If
If sCrit3 <> "" Then
SQL = SQL & " And " & sCrit3
End If
This example creates this SQL statement:
Select * From Table Where 1=1 And col2=7 And col5='Denver'
If all three criteria are blank the statement (Select * From Table Where 1=1) will return all records. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.