Here`s my problem:


aamort = Application.InputBox("Qual o ano q pretende imprimir?", Type:=1)

strSQL1 = "SELECT ID,descricao,anoaq,valaq FROM tbltransfer where [anoaq]<=" & aamort
strSQL1 = strSQL1 & " order by ID asc"
rs1.Open "tbltransfer", cn, adOpenDynamic, adLockOptimistic, adCmdTable

I want all records with anoaq<=aamort, where aamort is a variable asked at the user.

But this statement returns all records!!

why its returning the records with anoaq>aamort