This is for a cash flow routine. I have to create columns (one for each week) within a given period. The user enters the first and last date of the period. Then I have to determine how many columns I need. The data comes from various sources, but there is always a date attached to the transaction. The thing is, I already have the week numbers (using the week() function on the date column).
Then I apply the VfpXTab.prg that comes with VFP and get the cursor, but the resulting headings are N_28,N_29,N_30, etc. I want to convert the headings to something like: "Sep 7 to Sep 11", "Sep 14 to Sep 18", etc. I know I could do a little programming to get the headers, but I thought there was a VFP function that would do it. Anthony Gundrum's technique is a good start though. Rafael Copquin ----- Original Message ----- From: "Stephen Russell" <[email protected]> To: <[email protected]> Sent: Tuesday, September 15, 2009 6:38 PM Subject: Re: date functions On Tue, Sep 15, 2009 at 2:12 PM, Rafael Copquin <[email protected]> wrote: > Given a week number, what function should I use to determine the range of > dates of that particular week? > > Example: today is Sep 15th, 2009 > > week( date()) = 38 > > Now, if I know the week number (week 38), how can I tell the first and > last days of that week? > > Is there a specific function in VFP or should I build my own? ---------------------------- Roll another one! It has been a long time since I did the VFP date game. Can you define what the starting # for DOW() is like you can set that in SQL Server? That is the first part of the drill to set your starting point. Is Sunday or Monday #1 Will you pass in a DATE or at least the YEAR to your function or are you just going to deal with current year? Will you accept 53 as a week # for those straggler days? 365/7 = 52.143 Do you have to deal with 4 week months and 13 month years? See why there isn't one? :) -- Stephen Russell Sr. Production Systems Programmer SQL Server DBA Web and Winform Development Independent Contractor Memphis TN 901.246-0159 [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/dc6a4bdc56bb4888b53972df476d4...@rafael ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

