Date Range

Posted on 2002-07-15
Last Modified: 2010-05-02

how can I take a date and compare it to a number of days?

for exemple

signupDate = "27/06/2002"
today = date()
if((date - signupDate) > 30) then

?? Thanks
Question by:nfuids
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 20

Accepted Solution

hes earned 50 total points
ID: 7155492
Use This

Dim FileDiff
FileDiff = DateDiff("d",signupDate,today)
If FileDiff > 30 then.....
LVL 11

Expert Comment

ID: 7155499
Dim dSignup As Date
Dim dToday As Date

dSignup = "27/06/2002"
dToday = Date()

If dToday-dSignup > 30 Then
    'Do whatever you want to do here
End If




Author Comment

ID: 7155500
great, what type should I declare FileDiff as ?
LVL 20

Expert Comment

ID: 7155507
DateDiff Returns a Variant (Long)

Author Comment

ID: 7155514
Thanks for a quick answer

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

733 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