need help on DateDiff function!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Learner

    #1

    need help on DateDiff function!

    Hi ,
    I am trying to use DateDiff to get the date after subtracting 60
    days from today.

    Please help
    thanks
    -L

  • Kerry Moorman

    #2
    RE: need help on DateDiff function!

    Learner,

    I think you need to use DateAdd, not DateDiff:

    DateAdd(DateInt erval.Day, -60, Now)

    Kerry Moorman


    "Learner" wrote:
    [color=blue]
    > Hi ,
    > I am trying to use DateDiff to get the date after subtracting 60
    > days from today.
    >
    > Please help
    > thanks
    > -L
    >
    >[/color]

    Comment

    • Joe Sutphin

      #3
      Re: need help on DateDiff function!

      Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
      System.EventArg s) Handles Button1.Click

      Dim da As Date = Today

      da = da.AddDays(-60)

      MsgBox("60 days ago is " & da)

      End Sub



      Perhaps this will help.

      Joe



      "Learner" <pradev@gmail.c om> wrote in message
      news:1140108597 .085654.125450@ g44g2000cwa.goo glegroups.com.. .[color=blue]
      > Hi ,
      > I am trying to use DateDiff to get the date after subtracting 60
      > days from today.
      >
      > Please help
      > thanks
      > -L
      >[/color]


      Comment

      • Learner

        #4
        Re: need help on DateDiff function!

        Yes that works. Thanks for the help. Also, i am just wondering if you
        could help with me how do i handle windows file management in vb.net? i
        would use FileManagementS ystem in classic or vb script. Is there an
        article to go about it . Because i am moving Directories and
        subdirectories and files to a different location and also need to crete
        folders and subdirectories on the fly if it doesn't find them.

        I am trying with Imports System.IO but any code snippet to manage the
        folders and files?
        Thanks
        -L

        Comment

        • Joe Sutphin

          #5
          Re: need help on DateDiff function!

          You might find something useful here.



          Joe
          --

          "Learner" <pradev@gmail.c om> wrote in message
          news:1140114432 .792551.191080@ g43g2000cwa.goo glegroups.com.. .[color=blue]
          > Yes that works. Thanks for the help. Also, i am just wondering if you
          > could help with me how do i handle windows file management in vb.net? i
          > would use FileManagementS ystem in classic or vb script. Is there an
          > article to go about it . Because i am moving Directories and
          > subdirectories and files to a different location and also need to crete
          > folders and subdirectories on the fly if it doesn't find them.
          >
          > I am trying with Imports System.IO but any code snippet to manage the
          > folders and files?
          > Thanks
          > -L
          >[/color]


          Comment

          • Joe Sutphin

            #6
            Re: need help on DateDiff function!

            With My.Computer.Fil eSystem

            ..CreateDirecto ry("C:\Test")

            ..CopyDirectory ("C:\Test", "C:\Test1")

            MsgBox(.Directo ryExists("C:\Jo eSu"))

            'there are plenty more methods and properties for file management

            End With


            Hopefully, you're using 2005 ...

            Joe
            --

            "Learner" <pradev@gmail.c om> wrote in message
            news:1140114432 .792551.191080@ g43g2000cwa.goo glegroups.com.. .[color=blue]
            > Yes that works. Thanks for the help. Also, i am just wondering if you
            > could help with me how do i handle windows file management in vb.net? i
            > would use FileManagementS ystem in classic or vb script. Is there an
            > article to go about it . Because i am moving Directories and
            > subdirectories and files to a different location and also need to crete
            > folders and subdirectories on the fly if it doesn't find them.
            >
            > I am trying with Imports System.IO but any code snippet to manage the
            > folders and files?
            > Thanks
            > -L
            >[/color]


            Comment

            Working...