Menu
  • HOME
  • TAGS

How can I reliably convert YYYYMMDDhhmmss to a date/time?

sql,datetime,caché

You have to take the first 14 characters, from the example above: print convert(datetime,stuff(stuff(stuff(LEFT('20150614140520-0500',14) , 9, 0, ' '), 12, 0, ':'), 15, 0, ':')) ...

Caché SQL: Select string segments as separate columns?

sql,parsing,delimited-text,caché

This should work in Cache: select * from ( select $PIECE(text,',',1) fruit, $PIECE(text,',',2) color, $PIECE(text,',',3) car, $PIECE(text,',',4) name from mytable) where fruit = 'apple'; ...

Cannot figure out how to use MODULO/MODULUS function in Caché SQL

sql,modulo,caché

It appears from the examples that fn should be included, within the curly brackets: The following example shows the remainder returned by MOD. SELECT DISTINCT {fn MOD(5,3)} AS Remainder FROM Sample.Person returns 2 The following example shows the remainder returned by MOD with a negative dividend. SELECT DISTINCT {fn MOD(-5,3)}...