Okay, now I'm embarassed. I'm having trouble passing and returning values from a function. The Function call is
strTempDate contains a SQL date that needs some work before it will fit into a VB Date format. the work is done by the TimeCon function
I can get the data into the function, but it's only returning "" into w
Code:
Dim w As String w = TimeCon(strTempDate)
Code:
Private Function TimeCon(ByVal strTempDate As String)
Dim strDate As String
Dim StrTime As String
Dim dteDate As Date
Dim dteTime As Date
Dim dteDatTimComp As Date
Dim intTest As Integer
strDate = Left(strTempDate, InStr(1, strTempDate, "T", vbTextCompare) - 1)
dteDate = FormatDateTime(strDate, vbShortDate)
StrTime = Right(strTempDate, InStr(1, strTempDate, "T", vbTextCompare) - 1)
StrTime = Left(StrTime, InStr(1, strTempDate, "-", vbTextCompare) - 1)
dteTime = FormatDateTime(StrTime, vbLongTime)
dteDatTimComp = (dteDate & " " & dteTime)
w = CStr(dteDatTimComp)
intTest = 2
End Function
Comment