home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / CLIPPER / NCCLIB.ZIP / NCCCODE.ZIP / MONTHBEG.PRG < prev    next >
Text File  |  1992-11-04  |  994b  |  34 lines

  1. //═══════════════════════════════════════════════════════╕
  2. //  Program .....: Monthbeg                              │
  3. //  CopyRight ...: 1992 National Computer Consultants    │
  4. //                 All rights are reserved.              │
  5. //  Author ......: Greg Rice                             │
  6. //═══════════════════════════════════════════════════════╛
  7.  
  8. //───────────────────────────────────────┐
  9. // Function...: MonthBeg()               │
  10. // Syntax.....: x = MonthBeg(<exp>)      │
  11. //                <exp> - Date or month  │
  12. //                         <D>     <N>   │
  13. // ......... Finds First date for month  │
  14. //───────────────────────────────────────┘
  15.  
  16. Function MonthBeg( xDate )
  17.  
  18.     local xMonth, xYear, ret_val
  19.  
  20.  
  21.     if valtype(xDate) == 'N'
  22.       xMonth := xDate
  23.       xYear  := Year(Date())
  24.  
  25.     else
  26.       xMonth := Month(xDate)
  27.       xYear  := Year(xDate)
  28.  
  29.     Endif
  30.  
  31.     ret_val := ctod(str(xMonth,2,0) + "/01/" + str(xYear,4,0))
  32.  
  33. Return( ret_val )
  34.