Calculate Date

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • OuTCasT
    Contributor
    • Jan 2008
    • 374

    Calculate Date

    Hi All

    I need to add 3 months to a date so i can calculate when a clients email bundle is out dated.

    so for instance the client registed his bundle on 2009/09/01. I need to be able to add 3 months to this date so it comes out with 2009/12/01 and then compare the dates.

    so if the date was 2009/12/02 then it would be expired.
  • OuTCasT
    Contributor
    • Jan 2008
    • 374

    #2
    Solution

    Worked it out thanks

    Code:
    Dim StartDate As String   'Declare variables.
            Dim Months As Double
            Dim SecondDate As Date
            Dim IntervalType As DateInterval
            IntervalType = DateInterval.Month   ' Specifies months as interval.
            StartDate = TextBox1.Text
            SecondDate = CDate(StartDate)
            Months = "3"
            TextBox2.Text = DateAdd(IntervalType, Months, SecondDate)

    Comment

    Working...