Let(
[
_year = Right( "0000" & Year( fmdate ); 4 );
_month = Right( "00" & Month( fmdate ); 2);
_day = Right( "00" & Day( fmdate ); 2)
];
Case( IsEmpty( fmdate ); ""; "DATE " & SQLquote( Join( List( _year;_month;_day ); "-") ) )
)
/*
fmdate as '2019-06-05'
SQL92Date(get(CurrentDate)) -> DATE '2022-10-06'
by air.fsans@gmail.com 2022
dependencies:
Join(fmlist, delim)
*/
Let(
[
_hour = Right( "00" & Hour ( fmtime ); 2);
_minute = Right( "00" & Minute ( fmtime ); 2);
_second = Right( "00" & Seconds ( fmtime ); 2)
];
Case( IsEmpty( fmtime ); ""; "TIME " & SQLquote ( Join( List( _hour; _minute; _second); ": ") )
)
/*
fmtime as 'HH:MM:SS'
SQL92Time( get( CurrentTime ) ) -> TIME '18:08:57'
by air.fsans@gmail.com 2022
dependencies:
Split(str, delim)
Join(fmlist, delim)
*/
For Timestamp functions see this newest CF here (requires FM v19.5): SQL92Timestamp