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


infogwsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jrbbldrCommented:
If you look into your VFP Help file for the BETWEEN() function you will see how to use it properly.

BETWEEN(dCheckDate, dFirstDate, dLastDate)

Good Luck
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Missus Miss_SellaneusCommented:
What is the error?

Use "DATE()" instead of "NOW()".
0
infogwsAuthor Commented:
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
0
pcelbaCommented:
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
0
infogwsAuthor Commented:
found then solution elsewhere. thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
FoxPro

From novice to tech pro — start learning today.