home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / database / theory / 651 < prev    next >
Encoding:
Text File  |  1992-12-14  |  1.2 KB  |  33 lines

  1. Newsgroups: comp.databases.theory
  2. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!caen!spool.mu.edu!umn.edu!csus.edu!netcom.com!netcomsv!butch!iscnvx!enterprise!news
  3. From: stroup@aspen.ops.lmsc.lockheed.com ()
  4. Subject: Re: date -> day of week conversion
  5. Message-ID: <1992Dec14.174550.24045@enterprise.rdd.lmsc.lockheed.com>
  6. Lines: 19
  7. Sender: news@enterprise.rdd.lmsc.lockheed.com
  8. Nntp-Posting-Host: aspen.ops.lmsc.lockheed.com
  9. Reply-To: stroup@aspen.ops.lmsc.lockheed.com ()
  10. Organization: Lockheed Missiles And Space Co.
  11. References: <Byqssz.Bu5@gabriel.keele.ac.uk> <dtb.724154401@otto>
  12. Date: Mon, 14 Dec 92 17:45:50 GMT
  13.  
  14.  
  15. >
  16. csa09@keele.ac.uk (Paul Singleton) writes:
  17.  
  18. >Can anyone produce SQL code to convert a date from DD/MM/YY (or MM/DD/YY)
  19. >format into the corresponding day of the week?  I assume that you can
  20. >get at the individual DD, MM and YY fields (as integers?).
  21.  
  22. >
  23.  
  24. Maybe I'm missing the point here (or maybe this is an Oracle extension to 
  25. SQL) but can't you just use the to_char function:
  26.  
  27.     Select to_char(my_date,'DAY') from my_table;
  28.  
  29. According to the doc, DAY gives you the name of the day, padded with blanks 
  30. to a length of nine characters.
  31.  
  32.                         judie
  33.