1

Do anyone here Know how to get the previous month of a given date..
Example
given date: 11/25/2012
Output: 10/25/2012

thank you.. i know you can help me ..

3
Contributors
3
Replies
15
Views
4 Years
Discussion Span
Last Post by imBaCodes
0

well i dont know the exact function name that can solve the issue but you can use of the following to generate the same:-

dt = Month(Date) - 1 & "/" & Day(Date) & "/" & Year(Date)

hope this helps you . . .

1

Something like this should work:

Dim dt As Date
dt = #11/25/2012#

'DateAdd is a function specifically designed for date math operations.
dt = DateAdd("m", -1, dt)
MsgBox (dt)

Here's the MSDN page

Edited by tinstaafl

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.