Solved

Date Range

Posted on 2002-07-15
5
173 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
[X]
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
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying 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 (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

719 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