This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » legacy support » symfony 1.2 » using CASE WHEN ELSE in Doctrine
using CASE WHEN ELSE in Doctrine [message #98713] Fri, 07 May 2010 23:41
ftoledo  is currently offline ftoledo
Messages: 8
Registered: January 2008
Location: Dock Sud
Junior Member

Hi all

any chance to use CASE,WHEN from postgres?:

$q= new Doctrine_Query();
$q->create()
  ->addSelect("fecha, CASE WHEN fecha <'2010-10-10' 
       THEN '2009-09-09' ELSE fecha END as new_fecha")
  ->from("my_table")
  ->addOrderBy("new_fecha");



i get a syntax error because the dql parser compute that "CASE" is a field of my_table?

any workaround is appreciated! Confused

Saludos!


Dock Sud BBS
telnet://bbs.docksud.com.ar
http://www.docksud.com.ar
Previous Topic:slot / partial / or component for container div
Next Topic:Symfony Users in Vancouver BC Canada
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software