منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : مقارنه تارخين مع بعض
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
كاتب الموضوع : AhmedEssawy


كود :
Public Function compareDates(Date1 As Date, Date2 As Date) As _
Integer
' If Date1 is greater the function returns the number 1
' If Date2 is greater the function returns the number 2
' If Date1 equals Date2 the function returns the number 0

Select Case Date1
Case Is > Date2
compareDates = 1
Case Is < Date2
compareDates = 2
Case Else
compareDates = 0
End Select
End Function