Date Range

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
nfuidsAsked:
Who is Participating?
 
hesConnect With a Mentor Commented:
Use This

Dim FileDiff
FileDiff = DateDiff("d",signupDate,today)
If FileDiff > 30 then.....
0
 
joekendallCommented:
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
 
nfuidsAuthor Commented:
great, what type should I declare FileDiff as ?
0
 
hesCommented:
DateDiff Returns a Variant (Long)
0
 
nfuidsAuthor Commented:
Thanks for a quick answer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.