Print Page | Close Window

Finding the last month

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=3893
Printed Date: 29 March 2026 at 2:08am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Finding the last month
Posted By: pmormr
Subject: Finding the last month
Date Posted: 27 June 2003 at 9:35pm
I'm making a script to find all the records added within the last month. I'm trying to get the script to generate a date that is one month in the past. I.e. Today is 6/27/2003 and i would like the script to give a date of 5/27/2003. Is there a way to do this?

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/



Replies:
Posted By: ljamal
Date Posted: 28 June 2003 at 8:59am
Use the DateAdd function

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: michael
Date Posted: 28 June 2003 at 1:22pm
like ljamal said you can simply do lastmonth = dateadd("m",-1,date())

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: pmormr
Date Posted: 28 June 2003 at 3:53pm

thanks, i thought about that but i wasn't sure how to use it.



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: pmormr
Date Posted: 28 June 2003 at 4:07pm
i had the right idea but i forgot to put the quotes around the 'm'

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net