home *** CD-ROM | disk | FTP | other *** search
/ Software Du Jour / SoftwareDuJour.iso / BUSINESS / DBASE / CLIPUDF.ARC / DAYWORD.PRG < prev    next >
Text File  |  1986-02-04  |  768b  |  26 lines

  1. * Function ..... DAYWORD()
  2. * Author ....... Steve Straley
  3. * Date ......... August 21, 1985
  4. * Syntax ....... DAYWORD(date_exp)
  5. * Parameters ... Date_value
  6. * Returns ...... <string variable>
  7. * Notes ........ This function will return the a word string variable
  8. *                cooresponding to the date that is passed.  For example,
  9. *                on days like 1,21,31, the function will return "1st", or
  10. *                the "21st", etc.
  11.  
  12. FUNCTION Dayword
  13.  
  14. PARAMETERS in_date
  15.  
  16. in_day = str(day(in_date),2)
  17. in_val = val(substr(in_day,2,2))
  18. IF in_val > 10 .OR. < 20
  19.    in_day = in_day + "th"
  20. ELSE
  21.    in_val = val(substr(in_day,2,1))
  22.    in_day = in_day + SUBSTR("thstndrdthththththth", (in_val * 2)+1, 2)
  23. ENDIF
  24.  
  25. RETURN(in_day)
  26.