home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / database / theory / 647 next >
Encoding:
Internet Message Format  |  1992-12-12  |  1.5 KB

  1. Path: sparky!uunet!munnari.oz.au!titan!trlluna!bruce.cs.monash.edu.au!monu6!escargot!otto!dtb
  2. From: dtb@otto (David Bath)
  3. Newsgroups: comp.databases.theory
  4. Subject: Re: date -> day of week conversion
  5. Date: 12 Dec 92 10:00:01 GMT
  6. Organization: RMIT Computer Centre
  7. Lines: 25
  8. Message-ID: <dtb.724154401@otto>
  9. References: <Byqssz.Bu5@gabriel.keele.ac.uk>
  10. NNTP-Posting-Host: otto.bf.rmit.oz.au
  11.  
  12. csa09@keele.ac.uk (Paul Singleton) writes:
  13.  
  14. >Can anyone produce SQL code to convert a date from DD/MM/YY (or MM/DD/YY)
  15. >format into the corresponding day of the week?  I assume that you can
  16. >get at the individual DD, MM and YY fields (as integers?).
  17.  
  18. >Am I right in thinking that this is *not* the sort of functionality which
  19. >SQL was designed to express, and that in general it is not feasible to
  20. >define a relation by algorithm (in the way that Prolog programmers are so
  21. >accustomed to doing)?
  22.  
  23. Rumor has it that one SQL based DB, Empress, running on UNIX and VMS,
  24. permits you to define your own functions that can be embedded in the
  25. sql, letting you define that function and then
  26.     select surname, givname
  27.     where    day_of_week(birthdate) = 'Saturday'
  28.     from     emp;
  29.  
  30. David T. Bath    Email:dtb@otto.bf.rmit.oz.au    Phone:03-3477511
  31. Global Technology Corporation, 179 Grattan St, CARLTON, VIC, 3153, AUSTRALIA
  32. "Failure to emulate is the best revenge" - Marcus Aurelius
  33. -- 
  34. David T. Bath    Email:dtb@otto.bf.rmit.oz.au    Phone:03-3477511
  35. Global Technology Corporation, 179 Grattan St, CARLTON, VIC, 3153, AUSTRALIA
  36. "Failure to emulate is the best revenge" - Marcus Aurelius
  37.