Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Groupby not allowed in a subquery (report footer section =rowcount(*))

Status
Not open for further replies.

techtown

Technical User
Jun 9, 2004
2
MX
SELECT [ASOCIADOS DENSO].ID AS [NUMERO DE EMPLEADO], (SELECT COUNT([ID])FROM[FALTAS GENERALES] WHERE [ASOCIADOS DENSO].[ID]=[FALTAS GENERALES].[ID] and [FALTAS GENERALES].[FECHA]>(NOW()-365) and ( [faltas generales].[incon]=" 150 FALTA INJUSTIFICADA" or [faltas generales].[incon]=" 180 FALTA INJUSTIFICADA VALIDADA")) AS [Faltas Injustificadas], [ASOCIADOS DENSO].NOMBRE, [ASOCIADOS DENSO].ING, [Bajas Denso].BAJA, (([BAJA]-[ING])/30) AS Antiguedad
FROM [Faltas Generales], [ASOCIADOS DENSO] INNER JOIN [Bajas Denso] ON ([ASOCIADOS DENSO].ID = [Bajas Denso].ID) AND ([ASOCIADOS DENSO].ID = [Bajas Denso].ID)
GROUP BY [ASOCIADOS DENSO].ID, [ASOCIADOS DENSO].NOMBRE, [ASOCIADOS DENSO].ING, [Bajas Denso].BAJA, (([BAJA]-[ING])/30)
HAVING ((([Bajas Denso].BAJA) Between [Rango Inicio Fecha de Baja] And [Rango Final Fecha de baja]));


I have three tables, asociados denso, bajas denso and faltas generales, the problem with third table is that some employees will have not records on it, and if i have only, I cant display the records with values in the table 1 and 2 and with no records on the table #3, in other words i want to display records from tables 1, 2 even there is not records on table #3.

When i try to count the total of records resulted of this query, just to print in the report footer section, is not possible, because i need to put the two queries in one query or find another way to know how many records has a query to print in the report.

Hope this is clear!, Thanks in advance for your help
 
I find the answer by myself, forget to update sorry

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top