That's the best way to get the SQL working properly - to hard-code the 2 values and select a small amount of data, so you know exactly what you should get and can verify that you've got the correct data.
You might want:
SELECT A.*, B.* ;
FROM DOCUMENTOSCABCLI A, DOCUMENTOSLINCLI B ;
WHERE ;
A.C_TIPODOC = B.C_TIPODOC AND ;
A.C_ARMAZEM = B.C_ARMAZEM AND ;
A.C_COD_SER = B.C_COD_SER AND ;
A.C_NUMDOC = B.C_NUMDOC AND ;
BETWEEN(.....) ;
INTO CURSOR Documentos
One other thing to try to get started. You're string together all of the values and using BETWEEN. Try setting up some tables with just the records you want and taking out the BETWEEN.
I'm not sure why you're getting an empty cursor. Be sure you really do have the right data.
>Hi Cindy
>
>My SQL at this time is very limited, now i do the code bellow for test, i have the data in table that match the criteria and i get a empty cursor.
>
>I want only to view the five first documents, and i force the LcP and lcU
>
>lcP="000001"
>lcU="000005"
>
>SELECT * ;
>FROM DOCUMENTOSCABCLI A, DOCUMENTOSLINCLI B;
>WHERE A.C_TIPODOC+A.C_ARMAZEM+A.C_COD_SER+A.C_NUMDOC = ;
>B.C_TIPODOC+B.C_ARMAZEM+B.C_COD_SER+B.C_NUMDOC ;
>AND BETWEEN(A.C_TIPODOC+A.C_ARMAZEM+A.C_COD_SER+A.C_NUMDOC, lcP, lcU) ;
>INTO CURSOR DOCUMENTOS
>
>browse
>
>
>Thank's in Advance
>
>João Batista