query numero de visitas
Publicado por Cooler O'Connor (5 intervenciones) el 02/04/2012 20:41:23
Hola estoy atorado con un query, ya le he dado vueltas y no encuentro la solucion, necesito obtener el numero de veces que un socio ingreso al sistema, la informacion que tengo es la siguiente
CardID DateAction Action MemberType
2011050800002 8/6/2011 1 C
2011050800002 8/6/2011 1 C
2011050800002 8/6/2011 1 M
2011050800002 8/6/2011 1 C
2011050800002 8/6/2011 1 C
2011050800002 8/6/2011 1 C
2011050800002 8/6/2011 1 C
2011050800002 8/6/2011 1 C
2011050800002 8/6/2011 1 C
2011050800002 8/6/2011 1 C
2011050800002 8/7/2011 1 C
2011050800002 8/7/2011 1 C
2011050800002 8/7/2011 1 C
2011050800002 8/7/2011 1 M
2011050800002 8/7/2011 1 C
2011050800002 8/7/2011 1 C
el query db de agrupar la informacion por fecha de la sig forma
CardID DateAction Visitas MemberType
2011050800002 8/6/2011 1 C
2011050800002 8/6/2011 1 M
2011050800002 8/7/2011 1 C
2011050800002 8/7/2011 1 M
el query q realice es el siguiente pero no agrupa correctamente
select DISTINCT(CardID) as CREDENCIAL, count(CardID) as VISITAS,MemberType AS TIPOMEMBRESIA
from BitacoraMembresias where Action = 1 and DateAction between '2011-08-01' and '2011-08-30'
group by CardID,MemberType,DateAction
order by CardID
Espero me puedan ayudar
Saludos
CardID DateAction Action MemberType
2011050800002 8/6/2011 1 C
2011050800002 8/6/2011 1 C
2011050800002 8/6/2011 1 M
2011050800002 8/6/2011 1 C
2011050800002 8/6/2011 1 C
2011050800002 8/6/2011 1 C
2011050800002 8/6/2011 1 C
2011050800002 8/6/2011 1 C
2011050800002 8/6/2011 1 C
2011050800002 8/6/2011 1 C
2011050800002 8/7/2011 1 C
2011050800002 8/7/2011 1 C
2011050800002 8/7/2011 1 C
2011050800002 8/7/2011 1 M
2011050800002 8/7/2011 1 C
2011050800002 8/7/2011 1 C
el query db de agrupar la informacion por fecha de la sig forma
CardID DateAction Visitas MemberType
2011050800002 8/6/2011 1 C
2011050800002 8/6/2011 1 M
2011050800002 8/7/2011 1 C
2011050800002 8/7/2011 1 M
el query q realice es el siguiente pero no agrupa correctamente
select DISTINCT(CardID) as CREDENCIAL, count(CardID) as VISITAS,MemberType AS TIPOMEMBRESIA
from BitacoraMembresias where Action = 1 and DateAction between '2011-08-01' and '2011-08-30'
group by CardID,MemberType,DateAction
order by CardID
Espero me puedan ayudar
Saludos
Valora esta pregunta


0