?
Solved

Present date minus one month

Posted on 2005-04-08
4
Medium Priority
?
4,232 Views
Last Modified: 2008-01-09
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
0
Comment
Question by:MaximusMeridus
  • 3
4 Comments
 
LVL 66

Accepted Solution

by:
Jim Horn earned 2000 total points
ID: 13737467
In Access VBA you use DateAdd("m", -1, Date()).  Perhaps this works in ASP as well.
0
 
LVL 23

Expert Comment

by:apresto
ID: 13737837
try this:

Response.write Day(date()) & "/" & (Month(date())-1) & "/" & year(date())
0
 
LVL 23

Expert Comment

by:apresto
ID: 13737846
actually that wont work too well because if you get january (1) you will get 0 - sorry, my bad!
0
 
LVL 23

Expert Comment

by:apresto
ID: 13737870
jimhorn has nailed it!
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Loops Section Overview
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question