Group:  Microsoft Access » microsoft.public.access.adp.sqlserver
Thread: Access Query Transform.. Pivot to SQL Server

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Access Query Transform.. Pivot to SQL Server
"Mastercafe - Juan" <vbnet[ at ]mastercafe.com> 08.06.2006 17:40:58
Hi group i have this sql in a MDB that run perfect.
TRANSFORM Count([dbo_Incidencias tecnicas].Clave) AS CountOfClave
SELECT [dbo_Clientes y referencias].IdCliente, [dbo_Clientes y
referencias].Empresa, [dbo_Clientes y
referencias].FechaFinContratoMantenimientoHardware, dbo_Cuentas.Nombre
FROM ([dbo_Clientes y referencias] LEFT JOIN [dbo_Incidencias tecnicas] ON
[dbo_Clientes y referencias].IdCliente=[dbo_Incidencias tecnicas].IdCliente)
LEFT JOIN dbo_Cuentas ON [dbo_Incidencias
tecnicas].Tecnico=dbo_Cuentas.IdCuenta
GROUP BY [dbo_Clientes y referencias].IdCliente, [dbo_Clientes y
referencias].Empresa, [dbo_Clientes y
referencias].FechaFinContratoMantenimientoHardware, dbo_Cuentas.Nombre
PIVOT Format([Fecha],"mm");

I make part of translation to sql, so i don't know how to put Transform and
Pivot

SELECT TOP 100 PERCENT dbo.[Clientes y referencias].IdCliente,
dbo.[Clientes y referencias].Empresa,
dbo.[Clientes y
referencias].FechaFinContratoMantenimientoHardware, DATEPART(mm,
dbo.[Incidencias tecnicas].Fecha) AS Meses,
COUNT(dbo.[Incidencias tecnicas].Clave) AS Asistencias
FROM dbo.[Clientes y referencias] LEFT OUTER JOIN
dbo.[Incidencias tecnicas] ON dbo.[Clientes y
referencias].IdCliente = dbo.[Incidencias tecnicas].IdCliente
GROUP BY dbo.[Clientes y referencias].IdCliente, dbo.[Clientes y
referencias].Empresa, dbo.[Clientes y
referencias].FechaFinContratoMantenimientoHardware,
DATEPART(mm, dbo.[Incidencias tecnicas].Fecha)

--
Saludos desde Oviedo (Asturias)

Juan Menéndez
Mastercafe S.L.
www.mastercafe.com
juan[ at ]mastercafe.com

Si la información recibido te ha servido indicalo con otro post.
En caso de resolverlo por otros medios, indica la solución usada
ayudaras a otros y aprenderemos todos.


begin 666 Juan Menéndez.vcf
M0D5'24XZ5D-!4D0-"E9%4E-)3TXZ,BXQ#0I..DUE;NEN9&5Z.TIU86X-"D9.
M.DIU86X[ at ]365NZ6YD97H-"DY)0TM.04U%.DUA<W1E<F-A9F4-"D]21SI-05-4
M15)#049%(%-,#0I414P[2$]-13M63TE#13HY.#4Q,34W.# -"E1%3#M#14Q,
M.U9/24-%.C8R-RXU,S$N-S8T#0I!1%([2$]-13H[.U!L87IA(%!U97)T82!D
M92!%=7)O<&$[ at ],BP[ at ],2U$.T]V:65D;SM!<W1U<FEA<SLS,S Q,3M%<W!A\6$-
M"DQ!0D5,.TA/344[14Y#3T1)3D<]455/5$5$+5!224Y404),13I0;&%Z82!0
M=65R=&$[ at ]9&4[ at ]175R;W!A(#(L(#$M1#TP1#TP04]V:65D;RP[ at ]07-T=7)I87,[ at ]
M,S,P,3$],$0],$%%<W!A/48Q80T*55),.TA/344Z:'1T<#HO+W=W=RYM87-T
M97)C869E+F-O;0T*55),.U=/4DLZ:'1T<#HO+W=W=RYM87-T97)C869E+F-O
M;0T*14U!24P[4%)%1CM)3E1%4DY%5#IJ=6%N0&UA<W1E<F-A9F4N8V]M#0I2
[ at ]158Z,C P-C V,#A4,3<T,#4X6[ at ]T*14Y$.E9#05)$#0H`
`
end

Re: Access Query Transform.. Pivot to SQL Server
"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)> 09.06.2006 12:57:22
T-SQL 2000 doesn't offer support for the PIVOT and TRANSFORM statements; you
will have to write your own stuff for doing this. As a start, you may want
to take a look at the following references:

http://www.ftponline.com/archives/premier/mgznarch/vbpj/2001/10oct01/sqlpro0110/rj0110/rj0110-1.asp

http://support.microsoft.com/default.aspx?scid=KB;EN-US;q175574

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_qd_14_04j7.asp

http://www.sqlteam.com/item.asp?ItemID=2955


--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF


"Mastercafe - Juan" <vbnet[ at ]mastercafe.com> wrote in message
news:OpgRbLyiGHA.4884[ at ]TK2MSFTNGP03.phx.gbl...
[Quoted Text]
> Hi group i have this sql in a MDB that run perfect.
> TRANSFORM Count([dbo_Incidencias tecnicas].Clave) AS CountOfClave
> SELECT [dbo_Clientes y referencias].IdCliente, [dbo_Clientes y
> referencias].Empresa, [dbo_Clientes y
> referencias].FechaFinContratoMantenimientoHardware, dbo_Cuentas.Nombre
> FROM ([dbo_Clientes y referencias] LEFT JOIN [dbo_Incidencias tecnicas] ON
> [dbo_Clientes y referencias].IdCliente=[dbo_Incidencias
> tecnicas].IdCliente) LEFT JOIN dbo_Cuentas ON [dbo_Incidencias
> tecnicas].Tecnico=dbo_Cuentas.IdCuenta
> GROUP BY [dbo_Clientes y referencias].IdCliente, [dbo_Clientes y
> referencias].Empresa, [dbo_Clientes y
> referencias].FechaFinContratoMantenimientoHardware, dbo_Cuentas.Nombre
> PIVOT Format([Fecha],"mm");
>
> I make part of translation to sql, so i don't know how to put Transform
> and Pivot
>
> SELECT TOP 100 PERCENT dbo.[Clientes y referencias].IdCliente,
> dbo.[Clientes y referencias].Empresa,
> dbo.[Clientes y
> referencias].FechaFinContratoMantenimientoHardware, DATEPART(mm,
> dbo.[Incidencias tecnicas].Fecha) AS Meses,
> COUNT(dbo.[Incidencias tecnicas].Clave) AS
> Asistencias
> FROM dbo.[Clientes y referencias] LEFT OUTER JOIN
> dbo.[Incidencias tecnicas] ON dbo.[Clientes y
> referencias].IdCliente = dbo.[Incidencias tecnicas].IdCliente
> GROUP BY dbo.[Clientes y referencias].IdCliente, dbo.[Clientes y
> referencias].Empresa, dbo.[Clientes y
> referencias].FechaFinContratoMantenimientoHardware,
> DATEPART(mm, dbo.[Incidencias tecnicas].Fecha)
>
> --
> Saludos desde Oviedo (Asturias)
>
> Juan Menéndez
> Mastercafe S.L.
> www.mastercafe.com
> juan[ at ]mastercafe.com
>
> Si la información recibido te ha servido indicalo con otro post.
> En caso de resolverlo por otros medios, indica la solución usada
> ayudaras a otros y aprenderemos todos.
>
>
>


Re: Access Query Transform.. Pivot to SQL Server
"Mastercafe - Juan" <vbnet[ at ]mastercafe.com> 09.06.2006 22:10:11
Thank you very much Sylvain

--
Saludos desde Oviedo (Asturias)

Juan Menéndez
Mastercafe S.L.
www.mastercafe.com
juan[ at ]mastercafe.com

Si la información recibido te ha servido indicalo con otro post.
En caso de resolverlo por otros medios, indica la solución usada
ayudaras a otros y aprenderemos todos.

"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
escribió en el mensaje news:%238sePR8iGHA.1260[ at ]TK2MSFTNGP05.phx.gbl...
[Quoted Text]
> T-SQL 2000 doesn't offer support for the PIVOT and TRANSFORM statements;
> you will have to write your own stuff for doing this. As a start, you may
> want to take a look at the following references:
>
> http://www.ftponline.com/archives/premier/mgznarch/vbpj/2001/10oct01/sqlpro0110/rj0110/rj0110-1.asp
>
> http://support.microsoft.com/default.aspx?scid=KB;EN-US;q175574
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_qd_14_04j7.asp
>
> http://www.sqlteam.com/item.asp?ItemID=2955
>
>
> --
> Sylvain Lafontaine, ing.
> MVP - Technologies Virtual-PC
> E-mail: http://cerbermail.com/?QugbLEWINF
>
>
> "Mastercafe - Juan" <vbnet[ at ]mastercafe.com> wrote in message
> news:OpgRbLyiGHA.4884[ at ]TK2MSFTNGP03.phx.gbl...
>> Hi group i have this sql in a MDB that run perfect.
>> TRANSFORM Count([dbo_Incidencias tecnicas].Clave) AS CountOfClave
>> SELECT [dbo_Clientes y referencias].IdCliente, [dbo_Clientes y
>> referencias].Empresa, [dbo_Clientes y
>> referencias].FechaFinContratoMantenimientoHardware, dbo_Cuentas.Nombre
>> FROM ([dbo_Clientes y referencias] LEFT JOIN [dbo_Incidencias tecnicas]
>> ON [dbo_Clientes y referencias].IdCliente=[dbo_Incidencias
>> tecnicas].IdCliente) LEFT JOIN dbo_Cuentas ON [dbo_Incidencias
>> tecnicas].Tecnico=dbo_Cuentas.IdCuenta
>> GROUP BY [dbo_Clientes y referencias].IdCliente, [dbo_Clientes y
>> referencias].Empresa, [dbo_Clientes y
>> referencias].FechaFinContratoMantenimientoHardware, dbo_Cuentas.Nombre
>> PIVOT Format([Fecha],"mm");
>>
>> I make part of translation to sql, so i don't know how to put Transform
>> and Pivot
>>
>> SELECT TOP 100 PERCENT dbo.[Clientes y referencias].IdCliente,
>> dbo.[Clientes y referencias].Empresa,
>> dbo.[Clientes y
>> referencias].FechaFinContratoMantenimientoHardware, DATEPART(mm,
>> dbo.[Incidencias tecnicas].Fecha) AS Meses,
>> COUNT(dbo.[Incidencias tecnicas].Clave) AS
>> Asistencias
>> FROM dbo.[Clientes y referencias] LEFT OUTER JOIN
>> dbo.[Incidencias tecnicas] ON dbo.[Clientes y
>> referencias].IdCliente = dbo.[Incidencias tecnicas].IdCliente
>> GROUP BY dbo.[Clientes y referencias].IdCliente, dbo.[Clientes y
>> referencias].Empresa, dbo.[Clientes y
>> referencias].FechaFinContratoMantenimientoHardware,
>> DATEPART(mm, dbo.[Incidencias tecnicas].Fecha)
>>
>> --
>> Saludos desde Oviedo (Asturias)
>>
>> Juan Menéndez
>> Mastercafe S.L.
>> www.mastercafe.com
>> juan[ at ]mastercafe.com
>>
>> Si la información recibido te ha servido indicalo con otro post.
>> En caso de resolverlo por otros medios, indica la solución usada
>> ayudaras a otros y aprenderemos todos.
>>
>>
>>
>
>


Re: Access Query Transform.. Pivot to SQL Server
"aaron.kempf[ at ]gmail.com" <aaron.kempf[ at ]gmail.com> 20.06.2006 04:55:38

SQL 2005 express does.

it is free and it doesn't have a governor.

buy the fastest dual core you can with about 1.5gb ram.. fast fast fast
processor.



Mastercafe - Juan wrote:
[Quoted Text]
> Thank you very much Sylvain
>
> --
> Saludos desde Oviedo (Asturias)
>
> Juan Menéndez
> Mastercafe S.L.
> www.mastercafe.com
> juan[ at ]mastercafe.com
>
> Si la información recibido te ha servido indicalo con otro post.
> En caso de resolverlo por otros medios, indica la solución usada
> ayudaras a otros y aprenderemos todos.
>
> "Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
> escribió en el mensaje news:%238sePR8iGHA.1260[ at ]TK2MSFTNGP05.phx.gbl...
> > T-SQL 2000 doesn't offer support for the PIVOT and TRANSFORM statements;
> > you will have to write your own stuff for doing this. As a start, you may
> > want to take a look at the following references:
> >
> > http://www.ftponline.com/archives/premier/mgznarch/vbpj/2001/10oct01/sqlpro0110/rj0110/rj0110-1.asp
> >
> > http://support.microsoft.com/default.aspx?scid=KB;EN-US;q175574
> >
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_qd_14_04j7.asp
> >
> > http://www.sqlteam.com/item.asp?ItemID=2955
> >
> >
> > --
> > Sylvain Lafontaine, ing.
> > MVP - Technologies Virtual-PC
> > E-mail: http://cerbermail.com/?QugbLEWINF
> >
> >
> > "Mastercafe - Juan" <vbnet[ at ]mastercafe.com> wrote in message
> > news:OpgRbLyiGHA.4884[ at ]TK2MSFTNGP03.phx.gbl...
> >> Hi group i have this sql in a MDB that run perfect.
> >> TRANSFORM Count([dbo_Incidencias tecnicas].Clave) AS CountOfClave
> >> SELECT [dbo_Clientes y referencias].IdCliente, [dbo_Clientes y
> >> referencias].Empresa, [dbo_Clientes y
> >> referencias].FechaFinContratoMantenimientoHardware, dbo_Cuentas.Nombre
> >> FROM ([dbo_Clientes y referencias] LEFT JOIN [dbo_Incidencias tecnicas]
> >> ON [dbo_Clientes y referencias].IdCliente=[dbo_Incidencias
> >> tecnicas].IdCliente) LEFT JOIN dbo_Cuentas ON [dbo_Incidencias
> >> tecnicas].Tecnico=dbo_Cuentas.IdCuenta
> >> GROUP BY [dbo_Clientes y referencias].IdCliente, [dbo_Clientes y
> >> referencias].Empresa, [dbo_Clientes y
> >> referencias].FechaFinContratoMantenimientoHardware, dbo_Cuentas.Nombre
> >> PIVOT Format([Fecha],"mm");
> >>
> >> I make part of translation to sql, so i don't know how to put Transform
> >> and Pivot
> >>
> >> SELECT TOP 100 PERCENT dbo.[Clientes y referencias].IdCliente,
> >> dbo.[Clientes y referencias].Empresa,
> >> dbo.[Clientes y
> >> referencias].FechaFinContratoMantenimientoHardware, DATEPART(mm,
> >> dbo.[Incidencias tecnicas].Fecha) AS Meses,
> >> COUNT(dbo.[Incidencias tecnicas].Clave) AS
> >> Asistencias
> >> FROM dbo.[Clientes y referencias] LEFT OUTER JOIN
> >> dbo.[Incidencias tecnicas] ON dbo.[Clientes y
> >> referencias].IdCliente = dbo.[Incidencias tecnicas].IdCliente
> >> GROUP BY dbo.[Clientes y referencias].IdCliente, dbo.[Clientes y
> >> referencias].Empresa, dbo.[Clientes y
> >> referencias].FechaFinContratoMantenimientoHardware,
> >> DATEPART(mm, dbo.[Incidencias tecnicas].Fecha)
> >>
> >> --
> >> Saludos desde Oviedo (Asturias)
> >>
> >> Juan Menéndez
> >> Mastercafe S.L.
> >> www.mastercafe.com
> >> juan[ at ]mastercafe.com
> >>
> >> Si la información recibido te ha servido indicalo con otro post.
> >> En caso de resolverlo por otros medios, indica la solución usada
> >> ayudaras a otros y aprenderemos todos.
> >>
> >>
> >>
> >
> >

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net