Print Page | Close Window

Date Comparison

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=4792
Printed Date: 30 March 2026 at 3:01pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Date Comparison
Posted By: silvaduro
Subject: Date Comparison
Date Posted: 06 August 2003 at 3:10am

Hey,

I'm using a field in my database called 'date' which is automatically set to 'Now()'. I was wondering how I would, say, check if seven, fourteen and twenty-one days have passed.

Basically, I need something to happen if a week, two weeks or three weeks have passed.

Thanks,

~silva




Replies:
Posted By: Phat
Date Posted: 06 August 2003 at 3:30am

Use DateDiff

E.g

If DateDiff("d",date1,date2) > 7 Then
    Go eat food
End If

"d" measn days you also have other such as "n" for minute "m" for month and heaps more.

You should not call fields in your database date either as it will cause issues with your sql make sure you use [date] when doing sql. In access anyway.

 

     



-------------
http://buildit.sitesell.com/sitebuildithome.html - Get a website that sells



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