Using Smart Date Values

Most of the date fields in CIRS are defined as Smart Dates.  Smart date values are stored as the number of days lapsed since December 31, 1900, but display in a reader friendly date format with slashes.  Below are tips for using smart date values in screening statements and defines:

 

  • When used in an IF statement, smart date values do not require single quotes and can be typed with or without slashes.

    For example: IF PH:PAYPERIOD EQ 2004/06  or   IF PH:PAYPERIOD EQ 200406

  • When used in a WHERE statement, smart date values can be typed with or without slashes.  However, if typed with slashes, the value must be enclosed in single quotes.  Note:  If a date is typed with slashes but is not enclosed in single quotes, the system will NOT generate an error, but will return incorrect results.

    For example: WHERE PH:PAYPERIOD EQ '2004/06'  or  WHERE PH:PAYPERIOD EQ 200406

  • When used in a DEFINE, smart date values must be enclosed in single quotes whether typed with or without the slashes.  

    For example: TEST/A3=IF EH:EMPDATE GE '06012004' THEN 'YES' ELSE 'NO';  

  • To compare smart date values in a screening statement, use the WHERE command.  

    For example: WHERE AC:EFFDATE EQ AC:EMPDATE

  • Smart date values that display as blank are actually stored as the integer 0.  When screening for blank values, use either '  ' or 0.  

    For example: IF AC:APPTXDTE EQ '  '  or  IF AC:APPTXDTE EQ 0

 

Related Topic:  Smart Dates