Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Generating a date from a week number

Featured Replies

I have a week number that I want to convert into the (monday) date that week begins on. Like next week is week 8 so i want to generate Feb 18, 2008, like it looks at the top of a quickbooks web entry. Its easy to go from date to week but this way isn't clear.

Are we talking about a week number that follows the same rules as Filemaker's WeekOfYear() function?

  • Author

yes, we are, but i'm starting with that.

But now i've decided that I shouldn't work with week numbers. I'll work with real dates and just increment or decrement them by 7 when moving thru records. But i'm trying to make a script that will give me the current 'week of' so if i clicked on it today i'd get "Feb 11, 2008"

The following calculation does not work and i've tried it so many ways i'll just give you the latest and someone can tell me what is wrong with my syntax.

Case (

DayName ( Get ( CurrentDate ) ) ="Monday"; Date ( Get ( CurrentDate ) ;

DayName ( Get ( CurrentDate ) ) ="Tuesday"; (Date ( Get ( CurrentDate )-1 ) );

)

Get (CurrentDate) is not a valid argument for the Date() function. In addition, your parentheses are placed incorrectly.

It seems that your week starts on Monday? That is NOT how FM computes its weeks. Anyway, to get the date of this week's starting Monday, you don't need an elaborate Case() statement, you can compute it directly by:

Get (CurrentDate) - DayOfWeek ( Get (CurrentDate) - 1 ) + 1

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.