Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

mysql case when on date

SELECT
  id,
  CASE
    WHEN date_activated > '2011-11-23 18:30:00' THEN 'after'
    WHEN date_activated > '2010-01-20 00:00:00' THEN 'before'
    ELSE 'not yet'
  END AS date_note
FROM table1;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mysql #case #date
ADD COMMENT
Topic
Name
2+4 =