IF day1<>"" and month1<>"" and year1<>"" THEN
sql= "SELECT * FROM Invoice WHERE day(InvoiceDate)="&day1&" And month(InvoiceDate)="&Month1&" And (year(InvoiceDate)+543)="&year1
ELSE
sql= "SELECT * FROM Invoice"
END IF
set rs = server.CreateObject("ADODB.Recordset")
rs.open sql,connect,1,3
%>