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.

Insert week and year

Featured Replies

I am trying to work out how I can insert week and year in a field. So I have a button and when I click it will insert "43 '07" or similar.

Or if you have a better idea, as I work with week's in my database, and every year have the same week's I have to separate them for each year.

Thanks,

Mats

Why a button? When an autoenter (update) could do exactly this provided the entry field is "text"... you can even tie a popup calendar to a text field...

Let (td=GetAsDate ( Self );WeekOfYear ( td ) & " '" & Right(Year ( td );2))

--sd

  • Author

I tried to insert your formula in a text field, and it did not work (give any value)?

I don't really understand what is autoenter but I think you mean that the value week and year will be inserted automatically when I work with the record.

I prefer to have a button to insert the value because I don't wont a new week in some of the records I work with. Only if I have a result / agreement with the customer I will click the "week button" and insert current week and year.

Ah I didn't see you were on fm8 when I used a fm9'ish thing - Sorry.

If you need the button to do so:

Let (td=Get(CurrentDate);WeekOfYear ( td ) & " '" & Right(Year ( td );2))

I would prefere Set Field[ over Insert Calculated result in the buttons one-liner, in order to make it independent of the layout!

--sd

  • Author

Aouch, sorry. I just changed to FM9 so the first formula maybe would be right?

But it did not work for me. As English is not my language, would you mind explain what you mean with your suggestion "Set Field"?

And also a quick guide how to implement the two formulas.

Thank you very much for your help!

No the first formula only works underneath a field, if scripted have Self as far as I have expirienced no workings.

I've made you a template including both methods I gave, in the first line the yellow'ish are you shown a calendar when trying to enter stuff in it, while the second always fill in the present week number and year following the clock in the computer's setup.

As English is not my language, would you mind explain what you mean

As you probably have guessed isn't it mine either, if you need something a bit more scandinavian might I suggest you rush to this instead:

http://www.filemakercenter.dk/Sektioner/Forum/forumForside.html

--sd

mats.zip

  • Author

Now it's working like I want. Thanks "Dane" ???

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.