home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / database / oracle / 2614 < prev    next >
Encoding:
Text File  |  1992-12-22  |  909 b   |  35 lines

  1. Newsgroups: comp.databases.oracle
  2. Path: sparky!uunet!timbuk.cray.com!hemlock.cray.com!cherry13!mike
  3. From: mike@cray.com (Mike Carney)
  4. Subject: Re: Question using BETWEEN/AND cond with NEXT_D
  5. Message-ID: <1992Dec22.140443.18742@hemlock.cray.com>
  6. Lines: 22
  7. Nntp-Posting-Host: cherry13
  8. Reply-To: mike@cray.com
  9. Organization: Cray Research, Inc.
  10. References: <echoy.724882423@cunews>
  11. Date: 22 Dec 92 14:04:43 CST
  12.  
  13. You have to be careful using date/time fields with the BETWEEN/AND operator.
  14. The date field may contain time as well as the date -- sysdate for example
  15. has both a date and a time component.  The trunc function can be used to 
  16. remove the time component.  Example:
  17.  
  18. SQL> select 'ok' from dual where sysdate = '22-dec-92';
  19.  
  20. no rows selected
  21.  
  22. SQL> select 'ok' from dual where trunc(sysdate) = '22-dec-92';
  23.  
  24. 'O
  25. --
  26. ok
  27.  
  28.  
  29. ---
  30.  
  31. Mike Carney  mike@cray.com         Cray Research, Inc.    (612) 683-5635
  32.          
  33.      
  34.  
  35.