Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select last 5 days in between
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00935195
Message ID:
00935211
Vues:
18
>Hello,
>
>MyTable is:
>
>cSname dDate
>
>aaaaaa 08/15/2004
>bbbbbb 08/15/2004
>
>cccccc 08/17/2004
>dddddd 08/17/2004
>
>eeeeee 08/19/2004
>
>ffffff 08/14/2004
>gggggg 08/14/2004
>
>hhhhhh 08/20/2004
>iiiiii 08/21/2004
>
>jjjjjj 08/03/2004
>kkkkkk 08/03/2004
>
>I would like to put the last 5 days into Mycursorresult to have
>
>aaaaaa 08/15/2004 ( day number 5 to pick )
>bbbbbb 08/15/2004
>
>cccccc 08/17/2004
>dddddd 08/17/2004
>
>eeeeee 08/19/2004
>
>hhhhhh 08/20/2004
>iiiiii 08/21/2004 ( day number 1 to pick )
>
>I try this but never worked because dDate can be skipped 1 or more days in
>between like the above sample.
>
>local ldStart,ldStop,lcQuery
>
>ldStart = first day to pick {08/21/2004}
>ldStop = 5th day to pick {08/15/2004}
>
>** and it is not the last 5 days in the row from 08/21/2004 to 08/17/2004
>
>lcQuery=Select * from mytable where dDate between ?ldStart and ?ldStop
>
>into mycursorresult
>
>Please fix my query or advise me how to do it
>TIA

If you know the starting point, then the BETWEEN() function should do what you need.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform