Question Permo Jacobs · Jan 17, 2018 substring only the year or month from current date #Caché how do you substring only the year or month from current date
Aman Rana · Jan 17, 2018 USER>Write $Piece($ZDate($Horolog,9)," ")JanuaryUSER>Write $Piece($ZDate($Horolog,3),"-")2018
Eduard Lebedyuk · Jan 17, 2018 You can use DATEPART function: w $SYSTEM.SQL.DATEPART("year", $h) >2018 w $SYSTEM.SQL.DATEPART("month", $h) >1 The advantage of this approach is more readable code.
USER>Write $Piece($ZDate($Horolog,9)," ")
January
USER>Write $Piece($ZDate($Horolog,3),"-")
2018
You can use DATEPART function:
The advantage of this approach is more readable code.