DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   ASP (http://www.daniweb.com/forums/forum62.html)
-   -   Small date problem (http://www.daniweb.com/forums/thread22657.html)

scialom Apr 27th, 2005 12:17 pm
Small date problem
 
Hi All,

I am getting a rabdom date from the db. Now for each date that I get I have to reduct 3.
For example:
I get 02/12/2005
The new date supposes to be: 30/11/2005

How can I do that?

Thanks,
Assaf

nicentral Apr 27th, 2005 12:44 pm
Re: Small date problem
 
Are you asking how you can subtract 3 months from a date? Pretty easy, use the vbscript dateadd function. I know it sounds backwards, but if you add a negative number you'll be subtracting in essence. In your case you would do it this way dateadd("m", -3, 02/12/2005)

Makes sense?

scialom Apr 27th, 2005 12:48 pm
Re: Small date problem
 
I meant 3 days but it's the same :p
Thanks, it helps

Assaf

radharadha May 15th, 2006 6:30 am
Re: Small date problem
 
If u r using VbScript simple gice CDate("urDate")-3

oscarsierra Jun 17th, 2006 8:55 am
Re: Small date problem
 
What does you query look like ??


All times are GMT -4. The time now is 4:50 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC