dataset de data para campo não funciona

Robert Berbert
Thu, 20 Sep 2012 18:35:51 +0000

Tenta assim:

$sql = “select “.
" if(dayofweek(now())=1, ‘domingo’,”.
" if(dayofweek(now())=2, ‘segunda’,”.
" if(dayofweek(now())=3, ‘terça’,".
" if(dayofweek(now())=4, ‘quarta’,".
" if(dayofweek(now())=5, ‘quinta’,".
" if(dayofweek(now())=6, ‘sexta’,‘sabado’)))))) as dia_de_hoje, date(now()) as hoje_eh,".
" if(dayofweek(now())=1, +7,".
" if(dayofweek(now())=2, +13,".
" if(dayofweek(now())=3, +12,".
" if(dayofweek(now())=4, +11,".
" if(dayofweek(now())=5, +10,".
" if(dayofweek(now())=6, +9, +8)))))) as diff_dias,".
" date(date_add(now(), interval if(dayofweek(now())=1, +7,".
" if(dayofweek(now())=2, +13,".
" if(dayofweek(now())=3, +12,".
" if(dayofweek(now())=4, +11,".
" if(dayofweek(now())=5, +10,".
" if(dayofweek(now())=6, +9,+8)))))) day)) as domingo";

sc_lookup(ds_domingo,$sql);

Lembrando que nem sempre a forma que é interpretada no builder é interpretada no código.