Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > SQL
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 30-11-2004
Avatar de vtdeleon
vtdeleon vtdeleon is offline
Miembro
 
Registrado: abr 2004
Ubicación: RD & USA
Posts: 3.236
Poder: 24
vtdeleon Va por buen camino
Question Transform

Buenas a tod@s

tengo una tabla en SQL de la siguente estructura:
CODIGO ____FECHA _____DIA _____TOTAL
______8 ___30/10/04 ____LUNES _______1000
_____10 ___30/10/04 ____LUNES ________500
_____15 ___30/10/04 ____LUNES ________400
______8 ___31/10/04 ____MARTES ______900
_____10 ___31/10/04 ____MARTES ______600
_____15 ___31/10/04 -___MARTES _____1000

y quiero transformarla :

CODIGO ___LUNES ___MARTES
______8 _____1000 ________900
_____10 ______500 ________600
_____15 ______400 _______1000

******************************************
TRANSFORM SUM(total) AS Sumatotals SELECT codigo
FROM venta
WHERE Fecha >= #30 / 10 / 04 # AND Fecha <= #31 / 10 / 04 #
GROUP BY codigo PIVOT DIA;

he tratado de hacerlo pero Delphi da un error: line 1 Incorrect Sintax near 'total'

que Estoy haciendo mal ??

Agregando al caso tambien quiero ponerle un total de la sumatoria de Lunes y Martes Al lados

Última edición por vtdeleon fecha: 30-11-2004 a las 12:41:04.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 23:44:29.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi