Solved

DateTime Function (Easy Point)

Posted on 2007-04-11
5
146 Views
Last Modified: 2010-04-23
hi there,
I have a function that is suposed to let me know when the date is 180 dyas older than todays date for instance if the date is September --, 2006 and i run my fucntion today i will let me know if this is true.

I know it has to do with the DateTime function and the add days but i dont remenber how to do it can you guys help me?
Thanks
0
Comment
Question by:jsctechy
  • 4
5 Comments
 
LVL 1

Author Comment

by:jsctechy
ID: 18891002
something like this:
DateTime.Today.AddDays(180)

but i need older not in the future!
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18891003
Hello jsctechy,

Something like:

myDate=dateadd("d",-180,date)
'myDate=10/13/2006
 
If  datediff("d",myDate,date)= 180 Then msgbox "180 days since..." & myDate




~sirbounty
0
 
LVL 67

Accepted Solution

by:
sirbounty earned 500 total points
ID: 18891011
Oh! .Net...
just use negative...
DateTime.Today.AddDays(-180)

to get 180 days 'ago'...
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18891040
Not sure how you're using your function, but something like this?

Dim myDate As Date=Date.Today.AddDays(-180) 'would get 180 days ago...


Or

If oldDate.AddDays(180)=Date.Today Then
 'oldDate is equal to '180 days ago'
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18891329
Thanx
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

743 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

14 Experts available now in Live!

Get 1:1 Help Now