Present date minus one month

Hi there,

How do I display this date

<%=Right("00" & Day(Date),2) & "/" & MonthName(Month(Date)) & "/" & Year(Date)%>

Minus one month.

In other words, today it 08/03/2005 but I always want it to display one month behind like 08/02/2005

Thanks

Max
LVL 1
MaximusMeridusAsked:
Who is Participating?
 
Jim HornConnect With a Mentor Microsoft SQL Server Developer, Architect, and AuthorCommented:
In Access VBA you use DateAdd("m", -1, Date()).  Perhaps this works in ASP as well.
0
 
aprestoCommented:
try this:

Response.write Day(date()) & "/" & (Month(date())-1) & "/" & year(date())
0
 
aprestoCommented:
actually that wont work too well because if you get january (1) you will get 0 - sorry, my bad!
0
 
aprestoCommented:
jimhorn has nailed it!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.