Results 1 to 6 of 6

Thread: DateAdd

  1. #1
    Join Date
    Feb 2004
    Posts
    19

    Unanswered: DateAdd

    LStart = Request.form("LStart")

    Plus30 = (DateAdd("d",30,Date()))


    I would like to use the Date Add Function to give me LStart + 30 Days

    I guess I'm just missing something.

    Thanks,
    -josh

  2. #2
    Join Date
    Mar 2003
    Location
    Atlanta, GA
    Posts
    191
    To add days, you should be able to just say date30=date+30. No need to use DateAdd, which allows other, more complex intervals to be added.

    Tim
    Tim

  3. #3
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    you want something more like...
    Code:
    LStart = Request.form("LStart")
    Plus30 = (DateAdd("d",30,CDate(LStart)))
    As said befoire, if the system knows LStart is a date you can just do a standard addition...
    Code:
    LStart = Request.form("LStart")
    Plus30 = CDate(LStart)+30
    looks like you are trying to do a start of month end of month type thing...if so why not try....
    Code:
    LStart = Request.From("LStart") ' Gets first day or month
    LEnd = DateAdd("d",-1, DateAdd("m",1,CDate(LStart))) ' Add 1 month, subtract 1 day
    Just in case you need it.

  4. #4
    Join Date
    Feb 2004
    Posts
    19
    I feel terrible, I'd tried those things.. I had the form name wrong on the input page.. Sorry Guys.

    -josh

  5. #5
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    heheheh it happens to the best of us. glad to hear you located your problem though.

  6. #6
    Join Date
    Feb 2004
    Posts
    19
    I was racking my brain up one side and down the other cause I was trying cdate and +30 and for the life of me couldn't figure it out.. Arrg somedays I'm glad I do ASP part time anymore.

    -josh

Posting Permissions

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