Add number of days to date variable

  • Hi,

    How do I add an integer value (i.e. number of days) to a date value within a Script Task?

    I have 2 variables I need to compare:

    dteFile (defined as Date). This is derived from part of a xml file (I am looping through a network folder for each file).

    dteCurr (defined as Date) which is a variable based on the current date

    I need to add a global variable value (i.e. 28 days) to the dteFile and then compare the 2 script task variables.

    The format is dd/mm/yyyy

    For example

    dteFile is #09/03/2010#

    and if 28 is added to dtefile

    then dteFile should become #06/04/2010#

    Note: I need the date format to remain as dd/mm/yyyy

    These should be compared and if dtefile < dteCurr then

    bolDate (a global variable) needs to be set to true

    Any ideas please?

    Thanks in advance,

  • Have you looked at DateAdd?



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply