Convert a day, month and year into a day numberΒΆ

encdate()

Convert a day. month and year into a day number


SYNTAX

encdate(field_id, day, month, year)

Converts day, month and year values into a Sculptor day number.

field_id

The receiving field for the Sculptor day number value. Field_id should be of type i4 or larger, and is normally formatted to a day number (/dn) or date and time (/td) type field. See Logical types.

day
month
year

The values to be converted. They may be field names, numbers, or any numerical expression that evaluates to an integer appropriate to the range for the field concerned.

If the component parts do not represent a proper date, then zero is returned in field_id and the function returns ERROR (1).

If all the component parts were valid, the function returns OKAY (0).


EXAMPLES

  1. Encode a day number from three numeric constants:

    !temp NewDate,,i4/dn
    
         encdate(tmp.NewDate,18,5,2003)
    
  2. This example encodes the last day of the current year:

    decdate(Day, Month, Year, sys.Date)
    Day = 31
    Month = 12
    encdate(LastDay, Day, Month, Year)
    

RELATED TOPICS

decdate()