Converting a DATETIME value to a DATE value

About this task

To convert a DATETIME value to a DATE value:

Procedure

  1. Use dtextend() to adjust the DATETIME qualifier to year to day.
  2. Apply dttoasc() to create a character string in the form yyyy-mm-dd.
  3. Use rdefmtdate() with a pattern argument of yyyy-mm-dd to convert the string to a DATE value.