check format date and calculate datediff
I get with macro a mid string from text file similar:
my_date=mid(curr_line,3,10) (note var my_date is dimensioned as date)
the date in txt file can be 15/11/2009 but can be **/**/**** or __/__/____ ecc..
2 prob:
1)how to controll when i get the mid string if my_date is a really date?
2)ho to control if my_date is less than current date?
if my_date is less than current date calculate diff of day from my_date and current date and return the diff in a var as long
tks... I hope to be clear
Re: check format date and calculate datediff
Use IsDate("your date variable goes here") to check whether or not value is actually a Date and DateDiff() function to calculate difference in days/weeks/etc...