Código SQL:
Ver originalSELECT * FROM (
SELECT
COUNT(DISTINCT [ORE_IDORDEN]) AS HYP
FROM
[GOMSA356].[dbo].[SER_ORDENDET] A,
[GOMSA356].[dbo].[SER_ORDEN] B
WHERE
A.[ORD_IDORDEN] = [ORE_IDORDEN]
AND.[ORE_STATUS]= 'T'
AND ORE_FECHAORD LIKE '%/04/2013'
AND ORD_TIPORDEN IN('H', 'J', 'Q', 'S', 'Z')
) AS t1
UNION
SELECT * FROM (
SELECT COUNT
(DISTINCT [ORE_IDORDEN]) AS MECANICA
FROM
[GOMSA356].[dbo].[SER_ORDENDET] A,
[GOMSA356].[dbo].[SER_ORDEN] B
WHERE
A.[ORD_IDORDEN] = [ORE_IDORDEN]
AND (B.[ORE_STATUS]= 'A'
OR B.[ORE_STATUS] = 'P')
AND ORE_FECHAORD LIKE '%/04/2013'
AND ORD_TIPORDEN IN('I', 'E', 'N', 'R', 'T', 'V', 'A')
) AS t2
saludos!