RJ Jackson
Technical User
Driving me crazy! What am I missing?
FileName: Whatever1_Whatever2_Whatever3_20180716143004
Initial Value: 20180716143004
Expected Date Result: 07/16/2018 using varDOS
Expected Time Result: 14:30:04 using varTOS
Here's what I got below. Basically trying to take that long value, and get the date and time in the above format and they'll store to two different fields.
Function GetDOS(text)
GetDOS = Field (text,"_",4)
End Function
Function ReformatDOS(YMD)
ReformatDOS = Mid(YMD,1,2) & "/" & Mid(YMD,3,2) & "/" & Mid(YMD,5,4)
End Function
Function GetTOS(text)
GetTOS = Field (text,"_",4)
End Function
Function ReformatTOS(YMD)
ReformatTOS = Mid(text,1,2) & ":" & Mid(test,3,2) & ":" & Mid(YMD,5,4)
End Function
-----Separate Application that is calling the VBScripts above; Should be good as I'm just getting the value from VB and store it as an index field in an app.------------
//Get Date of Service from FileName
SET varDOS SCRIPT GetDOS varFileName
SET varDOSF SCRIPT ReformatDOS varDOS
STORE varDOSF "DATE_OF_SERVICE"
//Get Time of Service from FileName
SET varTOS SCRIPT GetTOS varFileName
SET varTOSF SCRIPT GetTOSF varTOS
STORE varTOSF "TIME_OF_SERVICE
FileName: Whatever1_Whatever2_Whatever3_20180716143004
Initial Value: 20180716143004
Expected Date Result: 07/16/2018 using varDOS
Expected Time Result: 14:30:04 using varTOS
Here's what I got below. Basically trying to take that long value, and get the date and time in the above format and they'll store to two different fields.
Function GetDOS(text)
GetDOS = Field (text,"_",4)
End Function
Function ReformatDOS(YMD)
ReformatDOS = Mid(YMD,1,2) & "/" & Mid(YMD,3,2) & "/" & Mid(YMD,5,4)
End Function
Function GetTOS(text)
GetTOS = Field (text,"_",4)
End Function
Function ReformatTOS(YMD)
ReformatTOS = Mid(text,1,2) & ":" & Mid(test,3,2) & ":" & Mid(YMD,5,4)
End Function
-----Separate Application that is calling the VBScripts above; Should be good as I'm just getting the value from VB and store it as an index field in an app.------------
//Get Date of Service from FileName
SET varDOS SCRIPT GetDOS varFileName
SET varDOSF SCRIPT ReformatDOS varDOS
STORE varDOSF "DATE_OF_SERVICE"
//Get Time of Service from FileName
SET varTOS SCRIPT GetTOS varFileName
SET varTOSF SCRIPT GetTOSF varTOS
STORE varTOSF "TIME_OF_SERVICE