Solved

Date Range

Posted on 2002-07-15
5
167 Views
Last Modified: 2010-05-02
Hi!

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
0
Comment
Question by:nfuids
  • 2
  • 2
5 Comments
 
LVL 20

Accepted Solution

by:
hes earned 50 total points
ID: 7155492
Use This

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

Expert Comment

by:joekendall
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

Thanks!

Joe

0
 

Author Comment

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

Expert Comment

by:hes
ID: 7155507
DateDiff Returns a Variant (Long)
0
 

Author Comment

by:nfuids
ID: 7155514
Thanks for a quick answer
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

706 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

22 Experts available now in Live!

Get 1:1 Help Now