954,598 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

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

scialom
Newbie Poster
3 posts since Apr 2005
Reputation Points: 10
Solved Threads: 0
 

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?

nicentral
Junior Poster
166 posts since Apr 2005
Reputation Points: 14
Solved Threads: 5
 

I meant 3 days but it's the same :p
Thanks, it helps

Assaf

scialom
Newbie Poster
3 posts since Apr 2005
Reputation Points: 10
Solved Threads: 0
 

If u r using VbScript simple gice CDate("urDate")-3

radharadha
Newbie Poster
6 posts since May 2006
Reputation Points: 10
Solved Threads: 1
 

What does you query look like ??

oscarsierra
Newbie Poster
4 posts since Jun 2006
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You