Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Date type functions
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Date type functions
Miscellaneous
Thread ID:
00562983
Message ID:
00562983
Views:
47
Hello All,

I'm trying to figure dates to use in a select statement.

The week() function returns the number of the week in the year.

?week({^2001/10/14}) returns 42.

I want to count back 8, 16, 24, 32 & 40 weeks from this date and then select records that fall between the first and last date of each of the above weeks.

So, if 8 weeks back from 10/14/2001 is the week of 8/19/2001 to 8/25/2001, I want all records where the date_field is >= 8/19/2001 and date_field <= 8/25/2001.

The same would go for weeks 16, 24, 32 & 40.

I can store the start week to nweek and then subtract 8 to get nweekeight which equals 34 but I'm stuck on how you would find the first and last dates for week number 34.

Any advice, help, pointers would be much appreciated.

TIA,

Jim Harvey
Next
Reply
Map
View

Click here to load this message in the networking platform