Present date minus one month

Posted on 2005-04-08
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


Question by:MaximusMeridus
    LVL 65

    Accepted Solution

    In Access VBA you use DateAdd("m", -1, Date()).  Perhaps this works in ASP as well.
    LVL 23

    Expert Comment

    try this:

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

    Expert Comment

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

    Expert Comment

    jimhorn has nailed it!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
    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…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now