Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reverse dates to weeknumbers?

Status
Not open for further replies.

Brunoo

Technical User
Apr 23, 2004
1
NL
Hi there everyone,

Is there perhaps someone who can tell me if there is a way in FM to reverse the date to weeknumber feature?

What we want to do here, is fill in a certain weeknumber of the year x, and then we want FM to return the startingdate and the endingdate of that week.

Is this possible in a way??
(**When the weekofyear function is used, FM is handling the dates to weeknumber just fine, so now the other way arround?? . . .)

Thanking you'll for your reactions,

Bruno
 
No nice complementary function.
You could try setting up a table of week numbers and beginning dates. This would work for one year only but it wouldn't take a lot to expand it for multiple years.

Cheers,
Paul J.
 
Try and play with :

Date(1;1; Year(Get(CurrentDate))) + ( weekNumber * 7 )

Use stutus(...) instead of Get(...) if you on lower than FM 7, weeknumber is a numberfield...

HTH

JW
 
An other way :

(WeekNumber -1) * 7 + Date(1,1, Year(Status(CurrentDate))) + (7- DayofWeek(Date(1, 1, Year(Status(CurrentDate)))))

Where 'WeekNumber' is a number field into which the number of the week is being entered.

The dates this formula will produce will always be a Saturday - and will be the Saturday which occurs at the end of the weekNumber week.

If you want ti find the date of a different day within the numberWeek week, you could substract the relevant number of days from the formula.
So, f.i., to always find the date of the Friday, append '-1', a Thursday : '-2' etc....

HTH

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top