Tengo una caga grande, quizas no va a ca pero ni diea donde seria
tengo mi Servidor sql server 2008 Espress con windows 7 en Español y otro con sql server 2008 con Windows 2003 en Ingles
esta consulta en el W7 funciona y en el 2003 no
supongo que es por la fechas, o configuracion regional , alguna otra idea , ayuda urgente please !!
Código:
SELECT s.SOC_id_soc, ISNULL(SUM(pai.PxS_pag_pxs), 0) AS total_pagado, (SELECT ISNULL(SUM(VCU_val_vcu), 0) AS Expr1 FROM dbo.valorCuotaIntl WHERE (socio.fn_todate(VCU_ano_vcu, 01, 01) BETWEEN socio.fn_todate(2011, 01, 01) AND GETDATE())) - ISNULL(SUM(pai.PxS_pag_pxs), 0) AS total_deuda, MAX(s.SOC_nom_soc) AS SOC_nom_soc, MAX(s.SOC_pat_soc + ' ' + s.SOC_mat_soc) AS apellidos, MAX(TS.TSO_id_tso) AS TSO_id_tso, MAX(TS.TSO_nom_tso) AS tiposocio, MAX(z.ZON_id_zon) AS ZON_id_zon, MAX(z.ZON_nom_zon) AS ZON_nom_zon, (SELECT ISNULL(SUM(VCU_val_vcu), 0) AS Expr1 FROM dbo.valorCuotaIntl WHERE (socio.fn_todate(VCU_ano_vcu, 01, 01) BETWEEN socio.fn_todate(2011, 01, 01) AND GETDATE())) AS maxpago, DATEDIFF(mm, MAX(socio.fn_todate(pai.PxS_ano_pxs, 12, 31)), GETDATE()) AS meses_atraso, DATEDIFF(dd, MAX(socio.fn_todate(pai.PxS_ano_pxs, 12, 31)), GETDATE()) AS dias_atraso, MAX(s.SOC_est_soc) AS SOC_est_soc, MAX(fam.FAM_id_fam) AS fam_id_fam FROM dbo.pagoIntlXsocio AS pai RIGHT OUTER JOIN dbo.socio AS s ON pai.PxS_id_soc = s.SOC_id_soc INNER JOIN dbo.tipoSocio AS TS ON TS.TSO_id_tso = s.SOC_tip_soc INNER JOIN dbo.zona AS z ON z.ZON_id_zon = s.SOC_zon_soc INNER JOIN dbo.familia AS fam ON s.SOC_nom_fam = fam.FAM_id_fam GROUP BY s.SOC_id_soc