Tema: Super Query
Ver Mensaje Individual
  #8 (permalink)  
Antiguo 04/08/2003, 10:29
Avatar de RootK
RootK
Moderador
 
Fecha de Ingreso: febrero-2002
Ubicación: México D.F
Mensajes: 8.004
Antigüedad: 23 años
Puntos: 50
Gracias nuevamente Teri , mira.. ya probé la query.. pero me está marcando un error el siguiente error

Cita:
Invalid length parameter passed to the substring function.
y tengo la siguiente query:

Código PHP:
SELECT CategoryCount(Category) as Total, (Select CASE Left(categoryCharIndex(' 'category)) 
WHEN 'Bir' THEN 'Otros'
WHEN 'Datos' THEN 'Otros'
ELSE Left(categoryCharIndex(' 'Category) -1)
END 
AS category from reportcomplete
where client_name like 
'%renault.%') AS Sub_Q_1
from reportcomplete
where date_created 
convert(datetime,'01/01/2003',103)
and 
date_created convert(datetime,'01/02/2003',103)
group by category 
Por cierto.. me imagino que va un , despues de:

SELECT Category, Count(Category) as Total, (Select CASE Left(category, CharIndex(' ', category))

verdad.??

Y otra cosa, ésta consulta me va a devolver tres columnnas..?? o como esá funcionando exactamente la subquery..??

Gracias