home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast.iso / pcmag / vol12n22.zip / D2JUL.ZIP / NDY < prev   
Text File  |  1993-11-30  |  418b  |  10 lines

  1. *****************************************************************
  2. * FUNCTION ndy
  3. * Returns a character string of length 3, left padded with zeros
  4. * reflecting the number of the day of the year: 001-365 or 366.
  5. *****************************************************************
  6. FUNCTION ndy
  7. PARAMETER d
  8. boy = CTOD("01/01/"+LTRIM(STR(YEAR(IIF(EMPTY(d),DATE(),d)))))
  9. RETURN PADL(LTRIM(STR((d - boy) + 1)),3,'0')
  10.