If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > DateAdd

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-02-04, 14:42
iamjosh iamjosh is offline
Registered User
 
Join Date: Feb 2004
Posts: 19
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
Reply With Quote
  #2 (permalink)  
Old 03-02-04, 15:05
MrWizard MrWizard is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 03-02-04, 17:18
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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.
Reply With Quote
  #4 (permalink)  
Old 03-02-04, 18:10
iamjosh iamjosh is offline
Registered User
 
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
Reply With Quote
  #5 (permalink)  
Old 03-02-04, 18:41
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
heheheh it happens to the best of us. glad to hear you located your problem though.
Reply With Quote
  #6 (permalink)  
Old 03-02-04, 19:08
iamjosh iamjosh is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On