![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
![]() |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
|
|
#1
|
||||
|
||||
|
Hola.
Creo que tienes que finalizar el CASE con un END. O sea : Código:
with QueryAsu do
begin
SQL.Clear;
SQL.Add('select SESASU_CODIGO,SESASU_GRUPO,SESASU_ORDEN,');
SQL.Add('SESGRU_CODIGO,SESGRU_DESCRIP,SESGRU_MOSTRAR,');
SQL.Add('(CASE WHEN SESGRU_MOSTRAR = 1 THEN SEASU_ASUNTO ELSE SESGRU_DESCRIP END) as ASUNTO ');
SQL.Add('from SES'+Part+'ASU A inner join SES'+Part+'GRU on SESGRU_CODIGO=A.SESASU_GRUPO ');
SQL.Add('where SESASU_SESION='+#39+inttostr(SesCodigo)+#39);
SQL.Add(' order by SESASU_GRUPO,SESASU_ORDEN');
Open;
end;
__________________
Marc Guillot (Hi ha 10 tipus de persones, els que saben binari i els que no). |
|
#2
|
||||
|
||||
|
Faltaba el case, pero ahora me da:
Código:
Datatypes are not comparable in expression CASE |
|
#3
|
||||
|
||||
|
Hola.
¿ SEASU_ASUNTO y SESGRU_DESCRIP són del mismo tipo ?. En caso de ser de tamaño distinto, deberias forzar el mismo tamaño con un CAST. Ejplo. cast(SEASU_ASUNTO as varchar(100)) Saludos.
__________________
Marc Guillot (Hi ha 10 tipus de persones, els que saben binari i els que no). |
|
#4
|
||||
|
||||
|
he probado a hacer el cast que me propones y el siguiente:
Código:
(CASE WHEN SESGRU_MOSTRAR = 1 THEN SESASU_ASUNTO ELSE cast(SESGRU_DESCRIP as blob) END) 1.000.000 de gracias. |
![]() |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
|