Newbies bluezman_ Posted August 18, 2009 Newbies Posted August 18, 2009 How can I get a list of all Sundays for the current year in this format? 1/4/2009 1/11/2009 1/18/2009 and so on for the entire year... TIA
Newbies bluezman_ Posted August 18, 2009 Author Newbies Posted August 18, 2009 To populate a value list so that a user can select the correct corresponding Sunday from a list of dates as demonstrated in my first post.
comment Posted August 18, 2009 Posted August 18, 2009 I am not sure how do you want to handle that, since a calculation based on the current date cannot be stored - and if it's not stored, it cannot be used for a value list.
Newbies bluezman_ Posted August 18, 2009 Author Newbies Posted August 18, 2009 There is a scripted process that drives a user to the layout where the value list is used. I could use SetField to push the result to an indexed field and create a value list from that.
comment Posted August 18, 2009 Posted August 18, 2009 Why not let the script compile the list, then? Something like: ... Set Variable [ $y ; Year ( Get ( CurrentDate ) ) ] Set Variable [ $sun ; Let ( ny = Date ( 1 ; 1 ; $y ) ; nY - Mod ( nY ; -7 ) ) ] Loop Exit Loop If [ Year ( $sun ) > $y ] Set Variable [ $sundays ; $sundays & $sun & ¶ ] Set Variable [ $sun ; $sun + 7 ] End Loop # Set Field [ Yourfield ; $sundays ] ...
dwins Posted August 18, 2009 Posted August 18, 2009 Poor man's popup. This can also be done with one calculation field and one script. The calc field generates the next 52 Sunday dates from the current date forward, each separated by a return. The script takes the value in that field where the cursor resides and places that value in another field. I have a publication that runs on Thursdays. To set date for an ad or subscription you click on the date field, a button. If date field is empty, a list of dates appears, click on your choice, click date field again, the date is set. If date field is not empty, it is selected for editing.
Newbies bluezman_ Posted August 18, 2009 Author Newbies Posted August 18, 2009 Thanks Comment! That worked nicely.
Recommended Posts
This topic is 5635 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