jsctechy
asked on
DateTime Function (Easy Point)
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
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
Hello jsctechy,
Something like:
myDate=dateadd("d",-180,da te)
'myDate=10/13/2006
If datediff("d",myDate,date)= 180 Then msgbox "180 days since..." & myDate
~sirbounty
Something like:
myDate=dateadd("d",-180,da
'myDate=10/13/2006
If datediff("d",myDate,date)=
~sirbounty
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Not sure how you're using your function, but something like this?
Dim myDate As Date=Date.Today.AddDays(-1 80) 'would get 180 days ago...
Or
If oldDate.AddDays(180)=Date. Today Then
'oldDate is equal to '180 days ago'
Dim myDate As Date=Date.Today.AddDays(-1
Or
If oldDate.AddDays(180)=Date.
'oldDate is equal to '180 days ago'
Thanx
ASKER
DateTime.Today.AddDays(180
but i need older not in the future!