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.

Comparing Week Numbers

Featured Replies

Hi Guys,

Really just a follow on from a previous posting on using dates in FMPro.

I have a database which contains seminar information. The end result I'm aiming for is for users to log onto a web site and be given a list of all seminars occurring in that week. Simple enough idea, however I'm having a problem using the "WeekofYear" function.

To get the current date I'm using the following code:

LeftWords(DateToText(Status(CurrentDate)), 1) &

MiddleWords(DateToText(Status(CurrentDate)), 2, 1) &

RightWords(DateToText(Status(CurrentDate)), 1)

I get the date as a whole number (e.g. 11th March 2001 reads 11032001).

The dates have been entered into the db as real language, under three fields, e.g.:

field example value

day 14

month March

year 2001

What I want to be able to do is run the WeekofYear function against both sets of dates (i.e. server date & inputed date). If they equal each other the answer is "1" and if not "0". This way I can run the query looking for the number "1" in a specific field and thus only pull up the current seminars.

Just can't seem to get it to work. Anyone tried this before and got a method that works?

Any suggestions would be greatfully received,

Thanks,

Frazer

Sound like you're making it too hard. First for the server week:

Server Week (calculation, number) =

WeekofYear(Status(Current Date))

For the entered week:

Entered Week (calculation, number) =

WeekofYear(Date(

Case(

month = "January", 1,

month = "February", 2,

month = "March", 3,

month = "April", 4,

month = "May", 5,

month = "June", 6,

month = "July", 7,

month = "August", 8,

month = "September", 9,

month = "October", 10,

month = "November", 11,

month = "December", 12,

""), day, year))

-bd

  • Author

Works a treat! Thanks for the help,

Frazer

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.