Hi everyone!

I've read somewhere a code for getting the difference between two dates...can't remember it, does anyone know how to do?

For example; if you have one date (2006-05-04) and another date (2006-05-09) then the result should be 5.
Now this is an easy example that's very easy to build a code for like:

VB Code:
  1. result = Right(date2, 2) - Right(date1, 2)

But this code that I've seen works even for dates that crosses months like 2006-05-28 and 2006-06-12.

The code I've seen was a built in function in VB...does anyone know what it's called?

Happy for help!

//Alex