brainonastick Posted September 4, 2006 Posted September 4, 2006 Hi there, As far as I know the Get(Current Date) function is static and uses the computer clock date at the time the calcualtion is first created. I want the date to update at the start of every new day (at midnight) so that all date-dependent calculations auto-refresh too. How do I do this?
Lee Smith Posted September 4, 2006 Posted September 4, 2006 You don't need a Script for this, you need to unstore the calculation. Go into Define Fields, select the field with the Get (CurrentDate) in it, select Options, Storage Options, and select the button that says Do Not Store Calculated Result, Re Calculate when needed. HTH Lee
RedKetchup Posted August 5, 2010 Posted August 5, 2010 Hi sir I'm new in Pro FM 11, In short I just can not understand what you say. Let me explain. you give an indication to run(or execute) the Get (current date) in a field. My problem is that I find absolutely nothing of what you say I can not find the way to run this simple trick. I juste whant to have in my field the current date when i open my layout....Now i dont understand why but ther is nothing in my control ... i see nothing ? If this is possible can you give me step by step indication to follow to make this thing "Get current date" working. thanks
bruceR Posted August 5, 2010 Posted August 5, 2010 Hi sir I'm new in Pro FM 11, In short I just can not understand what you say. Let me explain. you give an indication to run(or execute) the Get (current date) in a field. My problem is that I find absolutely nothing of what you say I can not find the way to run this simple trick. I juste whant to have in my field the current date when i open my layout....Now i dont understand why but ther is nothing in my control ... i see nothing ? If this is possible can you give me step by step indication to follow to make this thing "Get current date" working. thanks No, Lee did not say anything about running or executing something. He suggested you modify something you have already created and therefore presumably know how to get to. Go into Define Fields Select the field with the Get (CurrentDate) in it Select Options, Storage Options Select the button that says Do Not Store Calculated Result, Re Calculate when needed.
bruceR Posted August 5, 2010 Posted August 5, 2010 Hi there, As far as I know the Get(Current Date) function is static and uses the computer clock date at the time the calcualtion is first created. I want the date to update at the start of every new day (at midnight) so that all date-dependent calculations auto-refresh too. How do I do this? This is probably not actually a good idea. It will be helpful if you describe more broadly what you are trying to do.
RedKetchup Posted August 10, 2010 Posted August 10, 2010 Hi BruceR I miss a step because it does not work in "Specify Calculation"..... I'll try to be as clear as possible. I have a field which is called CURRENT_DATE, I want when I open my layout as the current date is displayed in my fields current_date. Look what i do as shown in the help .I right click on my field and on the menu I choose "Setup Button", I click on "Perform Script" and I click on "specify". Now I select my script "DateX". My script contains the following code, "Insert Current Date [select; MyTable:: current_date]" ... But nothing happens I can not see my current date displayed in my field on my layout. Why... is it possible to do that. Thanks and sorry for my bad english Sylvain.
comment Posted August 10, 2010 Posted August 10, 2010 Please do not double-post: http://fmforums.com/forum/showtopic.php?tid/216128/
renovante Posted October 31, 2013 Posted October 31, 2013 You don't need a Script for this, you need to unstore the calculation. Go into Define Fields, select the field with the Get (CurrentDate) in it, select Options, Storage Options, and select the button that says Do Not Store Calculated Result, Re Calculate when needed. HTH Lee Hi, there When I disable the storage of the calculated result of the field, like Lee Smith said, i can’t get the data of that field in other table when i use it as a relationship key. How can i do this? Thanks
Lee Smith Posted October 31, 2013 Posted October 31, 2013 You can’t use a calculation field as the Foreign Key (FK) in your Relationship? See if this thread helps you http://fmforums.com/forum/topic/89938-a-relational-question-from-a-quite-simple-implementation/?p=412827 Lee
comment Posted October 31, 2013 Posted October 31, 2013 i can’t get the data of that field in other table when i use it as a relationship key. How can i do this? It would probably be best to open a new thread and explain why you want to use current date as the matchfield on the data side. Then we'll be able to see if there is another way to accomplish the same thing using an indexable field.
renovante Posted November 1, 2013 Posted November 1, 2013 i'm sorry because language difficulties... i have some trends that i rent. one week to one client, other week to another... so, i have a date field used as a key to a relationship with another table, that have two fields called initial_date and final_date, containing a field with the client code. what i intend to do is let the final_date blank until the trend is with the client. to do this i have to use Get(CurrentDate) function when that field is empty and, as Lee Smith said, disable the storage of the calculated result of the field. but, when i do this, the table relationship doesn't work. the solution is storage calculation result and manually fill all the records with the current date at every day. do you have another solution? thanks
comment Posted November 1, 2013 Posted November 1, 2013 do you have another solution? I might have, but I am not sure I understand the problem. Let's name the two tables, say Rentals and Viewer. IIUC, the calculation field is in the Rentals table and it calculates the end date of a rental as = Case ( IsEmpty ( EndDate ) ; Get ( CurrentDate ) ; EndDate ) Is that more or less correct? If so, what difference would it make to the related set if the calculation were changed to = Case ( IsEmpty ( EndDate ) ; Date ( 12 ; 31 ; 4000 ) ; EndDate ) which can be stored? 1
LaRetta Posted November 1, 2013 Posted November 1, 2013 Oh yes we do. Whether for this instance or not remains to be seen but the concept is still very clever and consider it stolen. Buck up and accept it.
renovante Posted November 1, 2013 Posted November 1, 2013 I might have, but I am not sure I understand the problem. Let's name the two tables, say Rentals and Viewer. IIUC, the calculation field is in the Rentals table and it calculates the end date of a rental as = Case ( IsEmpty ( EndDate ) ; Get ( CurrentDate ) ; EndDate ) Is that more or less correct? If so, what difference would it make to the related set if the calculation were changed to = Case ( IsEmpty ( EndDate ) ; Date ( 12 ; 31 ; 4000 ) ; EndDate ) which can be stored? Yes, it works. Thank you very much!
Recommended Posts
This topic is 4040 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 accountSign in
Already have an account? Sign in here.
Sign In Now