Results 1 to 3 of 3

Thread: Date function

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2000
    Location
    Netherlands
    Posts
    128
    Hi,

    Í need to get a date dd-mm-yy minus 1 week

    thanx for your help
    Remember Programmers don't sleep

  2. #2
    Member
    Join Date
    Nov 1999
    Location
    panama
    Posts
    57

    date problem

    use this:

    d = Format(Date - 7, "dd-mm-yy")

    rest once week only.
    carlosapv
    [email protected]
    THE TRUTH IS OUT THERE
    Visual Basic 6.0 SP5

  3. #3
    Addicted Member
    Join Date
    Aug 1999
    Location
    Ottawa,ON,Canada
    Posts
    217
    You could also use the more robust DateAdd function, example as follows:
    Code:
    Dim dtCurrent As Date
    Dim dtPrevWeek As Date
    
    dtCurrent = DateValue("2000-Feb-15")
    dtPrevWeek = DateAdd("ww", -1, dtCurrent)
    debug.print dtPrevWeek
    >> Outputs "02/08/2000"

    If you look up this function you'll see that it provides alot more functionality.

    Later.

Posting Permissions

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



Click Here to Expand Forum to Full Width