Wednesday, May 23, 2012

Convert code in MS Access to SQL server

The following two functions, I would like to convert them from Access into SQL server, how can I moddify my code? Thank you so much. I never use SQL server before, and trying to learn it hard. LIS is a drive



Public Function PathDate(Ndate As Date) As Long
PathDate = (Year(Ndate) * 10000) + (Month(Ndate) * 100) + Day(Ndate)
End Function

Public Function NormalDate(LISDate As Long) As Date

If (LISDate = -1) Then
NormalDate = "-1"
Else
NormalDate = MonthName(LISDate \ 100 Mod 100) & " " & LISDate Mod 100 & " ," & LISDate \ 10000
End If
End Function




No comments:

Post a Comment