Wednesday, February 13, 2008

Datediff simple code

datediff is a function to get the difference of two date. the result will be shown in integer type.

here the simple code that shown how to use the datediff function.


Private Sub Form_Load()
Dim a As Variant
Dim b As Variant

a = Format("3 / 14 / 2008", "dd-mm-yyyy")
b = Format("1 / 4 / 2008", "dd-mm-yyyy")

MsgBox DateDiff("y", a, b)

End Sub


enjoy it...

0 comments:

Google

Microsoft News for ADO .NET:

Our Email Address:

blog.programming@gmail.com