Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select last 5 days in between
Message
From
21/08/2004 11:11:47
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Select last 5 days in between
Miscellaneous
Thread ID:
00935195
Message ID:
00935195
Views:
49
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
Next
Reply
Map
View

Click here to load this message in the networking platform