Results 1 to 5 of 5

Thread: Dual Post

  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dual Post

    Also posted this in the VBA forum. I need to create a fiscal year field in Word 97 that accomplishes in Word what the following statement accomplished in English:

    If today's month and day are less than or equal to June 30, display the current year, else display current year + 1.

    I'm pretty weak on field syntax. Can anyone help. Thanks.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  2. #2
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: Dual Post

    Kevin,

    This is a matter of field calculations rather than VBA. I think the following will do it:
    { IF { DATE @ "MM" }<"07" { DATE " "yy" } { = { DATE @ "yy" }+1 # "00" } }
    Remember that you can't type in the braces but rather have to use Ctrl-F9 to insert fields.
    Take a look at http://www.addbalance.com/word/datefields2.htm. It may tell you more than you want to know about date calculations.

    Thank you for the interesting challenge. I will be adding it to my web pages.
    Charles Kyle Kenyon
    Madison, Wisconsin

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dual Post

    Charles,

    You nailed it! Thanks for saving me the hassle. But I've learned more about inserting these complex field codes and I thank you for that too!
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  4. #4
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: Dual Post

    With a four-digit format, the field would be:
    { IF { DATE @ "MM" }<"07" { DATE " "yyyy" } { = { DATE @ "yyyy" }+1 } }
    Charles Kyle Kenyon
    Madison, Wisconsin

  5. #5
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dual Post

    That's the one small change I made myself. Whoppee!
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •