| 作者:李啸林『… 文章来源:本站原创 点击数: 本日:{$DayHits} 更新时间:2003-12-15 12:50:30 |
|
Public Function SfzToXb(身份证号 As String) As String Dim i As Integer
If Len(身份证号) = 15 And IsNumeric(Right(身份证号, 1)) Then i = CInt(Right(身份证号, 1)) If i Mod 2 = 0 Then SfzToXb = "女" Else SfzToXb = "男" End If If Len(身份证号) = 18 And IsNumeric(mID(身份证号, 17, 1)) Then i = CInt(mID(身份证号, 17, 1)) If i Mod 2 = 0 Then SfzToXb = "女" Else SfzToXb = "男" End If
End Function
Public Function SfzToRq(身份证号 As String) As Date Dim strRq As String
If Len(身份证号) = 15 Then strRq = mID(身份证号, 9, 2) & "/" & mID(身份证号, 11, 2) & "/" & "19" & mID(身份证号, 7, 2) If IsDate(strRq) Then SfzToRq = CDate(strRq) End If If Len(身份证号) = 18 Then strRq = mID(身份证号, 11, 2) & "/" & mID(身份证号, 13, 2) & "/" & mID(身份证号, 7, 4) If IsDate(strRq) Then SfzToRq = CDate(strRq) End If
End Function
'长身份证到短身份证 Public Function LSfzToS(Sfz As String) As String LSfzToS = Left(Sfz, 6) & mID(Sfz, 9, 9) End Function
|