cerca="SELECT MVNUMDOC, MVALFDOC, MVDATDOC, MVTIPDOC, MVCODMAG, CLCODCLI, CLRAGSOC, MVTOTDOC "
cerca=cerca&" FROM MOVIME LEFT JOIN CLIFOR ON MVCOD_CF = CLCODCLI "
cerca=cerca&" WHERE MVTIPDOC='DT' AND MVTPCLFO='1' AND MV__ANNO='2019' "
cerca=cerca&" ORDER BY MVALFDOC, MVNUMDOC "'limit 100 "
Dim rs As ResultSet
rs = gSQL.ExecQuery(cerca)
Do While rs.NextRow
Log(rs.GetString("MVALFDOC"))
Loop
rs.Close