OK Ladies and Germs...
What gives here...? I'm trying to create a "SIMPLE" little function and it's crapping out on me.
What I'd like to do is this ... I have a table that has Date/Time stores in "8s0" format (YYYYMMDD/HHMMSS00 respectively)
I'd like to do a select statement with something like this...
Where the FmtDate Function takes '20060820' and converts it to '2006-08-20' and FmtTime takes '13223900' and converts it to '13:22:39'.
I created the following function (to start with) and tried the above call... it doesn't work.
Error Message: Syntax of date, time, or timestamp value not valid.
What gives? Any help with this and/or a time function that does the same thing would be greatly appreciated.
-R
What gives here...? I'm trying to create a "SIMPLE" little function and it's crapping out on me.
What I'd like to do is this ... I have a table that has Date/Time stores in "8s0" format (YYYYMMDD/HHMMSS00 respectively)
I'd like to do a select statement with something like this...
PHP Code:
Select AcctNo, FmtDate( Iss_DT ), FmtTime( Iss_TM ), CurrBal From TableName
I created the following function (to start with) and tried the above call... it doesn't work.
PHP Code:
Create Function FmtDate(In_Date Numeric)
Returns Date
Language SQL
Return Date( SubStr( Digits( In_Date ), 1, 4 ) || '-' ||
SubStr( Digits( In_Date ), 5, 2 ) || '-' ||
SubStr( Digits( In_Date ), 7, 2 ) )
What gives? Any help with this and/or a time function that does the same thing would be greatly appreciated.
-R
Comment