June 9, 200520 yr I am trying to paste a calculated result into a a date field The calculation is the following 1/next month/current year..endday/next month/current year in other words I need to find all records from the following month I hope that makes sense. thanks
June 9, 200520 yr Try like this: Insert Calc Result[Date_Field, DateToText(Date(Month(today),1,Year(Today))&".."& DateToText(Date(Month(today)+1,1,Year(Today))-1)
June 9, 200520 yr I prefer using Enter Find Mode [ ] and Set Field [ ] here. You don't have to have the field on layout as Insert Calculated Result [ ] requires and vs. 7 now allows calcs on date fields in finds. Today isn't in vs. 7: Date(Month(Get(CurrentDate)) + 1; 1; Year(Get(CurrentDate))) & "..." & Date(Month(Get(CurrentDate)) + 2; 0; Year(Get(CurrentDate))) Or even ... Let( d = Get(CurrentDate); Date(Month(d) + 1; 1; Year(d)) & "..." & Date(Month(d) + 2; 0; Year(d)) ) I'm unsure if Let() helps here but it's sure easier to work with. LaRetta
June 10, 200520 yr Author Ok, I've got Laretta's first calculation working fine in FM7. But I couldn't get aaa's calc working in FM5. this is what I have entered in the Insert calculated result box as a script step (which I am happy to use insert calc result in a script as I do have the field on the layout) DateToText(Date(Month(today),1,Year(Today))&".."& DateToText(Date(Month(today)+1,1,Year(Today))-1)
June 10, 200520 yr Author It's Ok , I've worked out what I did wrong. I am now trying to go one stage further and instead of having a button to trigger the script, I would like to have a pop-up menu that lists not only the name of next month but all of the following months.depending on which month was clicked, it would alter the script to account for the month chosen. How easy would it be to create a value list based on a calculated result (i.e. always show the following months and not a static list. thanks again
June 10, 200520 yr You must have one global field Month_Global where will you put your choosing month then in expression instead Month(today) you must put Month_Global. Other way is to create 12 buttons and 12 scripts. For user this way is more appreciate.
June 10, 200520 yr Author the problem I see with the buttons is that if the current month is June and someone clicks the January button it would show records from the previous January and not the forthcoming one.With your first suggestion , should I create a value list with all 12 months? I'm a little unclear of this. thanks
June 10, 200520 yr Yes! You right. You must create value list. Today i finishrd my work. Tomorrow, if you can not solve your problem, i will attach you example. You must choose Month_Global from Value List then find by: DateToText(Date(Month_Global,1,Year(Today))&".."& DateToText(Date(Month_Global+1,1,Year(Today))-1)
Create an account or sign in to comment