Skip to main content
Question

Format Field vs. Format Function

  • January 21, 2022
  • 1 reply
  • 4 views

Forum|alt.badge.img+7

Why is the format field in the pql-editor offering more options in formatting the output than the FORMAT() function? E.g. I can enter in the format field in the pql-editor the format '%d.%m.%y' without any occuring errors but not in the format function while converting a date to a string.

Format FunctionFormat Field 

1 reply

Forum|alt.badge.img+2
  • Level 0
  • January 28, 2022

Hello Franziska,

Unfortunately it seems that the 2 digit year %y is not currently supported by the FORMAT() function. If a 4 digit year is fine for you, please try this format: '%d.%m.%Y'

If you need a 2 digit year, try this PQL:

TO_STRING("FOCUS_INSTANCES"."AS_OF_DATE", FORMAT('%d.%m.')) || RIGHT(TO_STRING(YEAR("FOCUS_INSTANCES"."AS_OF_DATE"),2)