home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / database / informix / 2892 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  1.4 KB

  1. Path: sparky!uunet!spool.mu.edu!darwin.sura.net!bogus.sura.net!howland.reston.ans.net!usc!elroy.jpl.nasa.gov!swrinde!emory!emory!not-for-mail
  2. From: dave.snyder@snide.com (Dave Snyder)
  3. Newsgroups: comp.databases.informix
  4. Subject: Re: 4GL date routine, HOW?
  5. Date: 7 Jan 1993 15:18:04 -0500
  6. Organization: Mailing List Gateway
  7. Lines: 34
  8. Sender: walt@mathcs.emory.edu
  9. Distribution: world
  10. Message-ID: <1ii35sINNmj6@emory.mathcs.emory.edu>
  11. Reply-To: dave.snyder@snide.com (Dave Snyder)
  12. NNTP-Posting-Host: emory.mathcs.emory.edu
  13. X-Informix-List-ID: <list.1760>
  14.  
  15. Quoting Ed Gulczynski...
  16. } In 4gl I'm trying to calc. the number of days between 2 dates 
  17. } Here's what I've done.  This doesn't work at all????
  18. } I'd appreciate it if you could send me some working code that would 
  19. } yield p_diff as a valid integer value.
  20. }  .
  21. }  .
  22. } GLOBALS
  23. }     p_diff      INTEGER
  24. } END GLOBALS
  25. }  .
  26. }  .
  27. } LET p_diff  = TODAY - 60 UNITS DAY
  28. }     DISPLAY "diff=",
  29. }             p_diff         
  30. You are making things harder than they need to be... to calculate say,
  31. the number of days since an invoice was cut, do this:
  32.  
  33. GLOBALS
  34.     DEFINE  p_diff INTEGER
  35.     DEFINE  invoice_date DATE
  36. END GLOBALS
  37.  
  38. LET p_diff = TODAY - invoice_date
  39.  
  40. DAS
  41. -- 
  42. David Snyder @ Snide Computer Services - Folcroft, PA          Current Release
  43.                                                                is db4glgen-3.9
  44. UUCP:  ..!uunet!das13!dave   INTERNET:  dave.snyder@snide.com
  45.