Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Insert week and year


Mats

This topic is 6188 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This topic is 6188 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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