Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 531031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:15:31+00:00 2026-05-13T09:15:31+00:00

How do I add 2 years to a date in powerbuilder and account for

  • 0

How do I add 2 years to a date in powerbuilder and account for the leap year correctly?

We have a medical license application where the user would like the date to go expire two years. Current license date is 7/10/2010 and expire date should be 7/2/2012 I used relative date and added 729 if not a leap year and 730 if it was but that is messy.

I wish the relativedate function took another parameter to so you could pass in number years.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T09:15:31+00:00Added an answer on May 13, 2026 at 9:15 am

    How about:

    // adjusted from suggestions
    IF Month (ldt_OldDate) = 2 AND Day (ldt_OldDate) = 29 THEN
       ldt_NewDate = Date (Year(ldt_OldDate) + 2, 3, 1) 
       // or ... 2, 28) whichever you think is two years from Feb 29
    ELSE
       ldt_NewDate = Date (Year(ldt_OldDate) + 2, Month (ldt_OldDate), Day (ldt_OldDate))
    END IF
    

    Good luck,

    Terry

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the date 2010-11-24 and this date expires in 3 years. The expiry
Please enlight me on this : I'm simply trying to add 10 years to
I have a MySQL DATETIME field that holds the date of birth of a
I have a DatePicker which I follow changes with dp.init(dp.getYear(), dp.getMonth(), dp.getDayOfMonth(), new OnDateChangedListener()
I'm just having a look at ruby and was playing with the date/time thing.
I am trying to add some filters to a gridview that I am working
Certain event needs to happen before the end of the year when it's 10
I have recently started work on a project that has already been running for
I've created a category to help me deal with creating dates from year, month,
Need help finding or having a RegEx match a MM/YY or MM/YYYY format. My

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.