Link to home
Create AccountLog in
Avatar of infogws
infogwsFlag for Peru

asked on

Between Dates in Visual Fox Pro 2.6

I need to do a query from a range of dates, is there any way to do this is the query I'm using:

SELECT        cuoprevi.CODSOC, cuoprevi.CONTRATO, cuoprevi.NCUOTA, cuoprevi.CUFECHA, cuoprevi.CUFONDO, pagoprev.PATOTAL, cuoprevi.CUFLAG
FROM            cuoprevi, geprevis, pagoprev
WHERE        cuoprevi.CONTRATO = geprevis.CONTRATO AND pagoprev.CONTRATO = cuoprevi.CONTRATO
 AND (cuoprevi.CUFECHA BETWEEN geprevis.F_CONTRATO AND   NOW())
GROUP BY 1, 2, 3


the error is in between
ORDER BY cuoprevi.CUFECHA


ASKER CERTIFIED SOLUTION
Avatar of jrbbldr
jrbbldr

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Avatar of Missus Miss_Sellaneus
Missus Miss_Sellaneus
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of infogws

ASKER

I am running the query from a dataset in visual studio, I'm try this query
SELECT cuoprevi.CODSOC, cuoprevi.CONTRATO, cuoprevi.NCUOTA, cuoprevi.CUFECHA, cuoprevi.CUFONDO, pagoprev.PATOTAL, cuoprevi.CUFLAG
FROM cuoprevi, geprevis, pagoprev
WHERE (cuoprevi.CONTRATO = geprevis.CONTRATO) AND (pagoprev.CONTRATO = cuoprevi.CONTRATO) AND BETWEEN (cuoprevi.CUFECHA, geprevis.f_contrato, date ())
GROUP BY 1, 2, 3
BY ORDER cuoprevi.CUFECHA

the error says: unable to parse the query text
1) Visual Fox Pro 2.6 does not exist
2) "BY ORDER" should be reported as error
3) What is the reason for GROUP BY in the query? You are groupping by 3 columns but you don't use any aggregate function in the query which is not correct.
4) Post the code you are using in Visual Studio incl. connection string. It will tell much more and allow to help better.


Note to jrbbldr
 x BETWEEN y AND z   is allowed in FoxPro
Avatar of infogws

ASKER

found then solution elsewhere. thanks!