[thelist] ASP and PHP Correlation

Joshua Olson joshua at waetech.com
Tue Jul 27 09:20:32 CDT 2004


> -----Original Message-----
> From: Luther, Ron
> Sent: Tuesday, July 27, 2004 10:05 AM
> 
> RonL.
> (Obviously stalling for time because he doesn't want to wrestle 
> with that nasty SQL 'decode' he should be working on. [Select 
> the appropriate column based on the sysdate at run time - "Oh, 
> it's July is it? Then we'll give you column 9!" Grrrr.])

Ron,

Sounds like a good time for Case...When.  Example (In MSSQL Syntax)

SELECT thevalue = 
  CASE 
    WHEN DatePart(m, GetDate()) = 1 THEN col1
    WHEN DatePart(m, GetDate()) = 2 THEN col2
  END
FROM thetable

<><><><><><><><><><>
Joshua Olson
Web Application Engineer
WAE Tech Inc.
http://www.waetech.com/service_areas/
706.210.0168 



More information about the thelist mailing list