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

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 12-06-2006
dariana20 dariana20 is offline
Miembro
 
Registrado: may 2006
Posts: 15
Poder: 0
dariana20 Va por buen camino
Question calculo en dbgrid

Necesito saber como lograr q un campo de un dbgrid me muestre el resultado
de la multilplicacion de otros dos.Estoy trabajando con sql server.
???????
Responder Con Cita
  #2  
Antiguo 12-06-2006
Avatar de delphi.com.ar
delphi.com.ar delphi.com.ar is offline
Federico Firenze
 
Registrado: may 2003
Ubicación: Buenos Aires, Argentina *
Posts: 5.932
Poder: 27
delphi.com.ar Va por buen camino
Puedes hacerlo desde la consulta:
Código SQL [-]
SELECT CAMPO1, CAMPO2, CAMPO1*CAMPO2 PRODUCTO FROM TABLA
O con campos calculados:
Cita:
Empezado por Ayuda de Delphi
To create a calculated field in the New Field dialog box:

1 Enter a name for the calculated field in the Name edit box. Do not enter the name of an existing field.
2 Choose a data type for the field from the Type combo box.
3 Enter the size of the field in the Size edit box, if appropriate. Size is only relevant for fields of type TStringField, TBytesField, and TVarBytesField.

4 Select Calculated or InternalCalc in the Field type radio group. InternalCalc is only available if you are working with a client dataset. The significant difference between these types of calculated fields is that the values calculated for an InternalCalc field are stored and retrieved as part of the client dataset's data.
5 Choose OK. The newly defined calculated field is automatically added to the end of the list of persistent fields in the Field editor list box, and the component declaration is automatically added to the form's or data module's type declaration.

6 Place code that calculates values for the field in the OnCalcFields event handler for the dataset. For more information about writing code to calculate field values, see Programming a calculated field.
Saludos!
__________________
delphi.com.ar

Dedique el tiempo suficiente para formular su pregunta si pretende que alguien dedique su tiempo en contestarla.
Responder Con Cita
Respuesta



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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Calculo de RFC u Homoclave jdattoli OOP 2 13-12-2005 18:01:47
error calculo en udf marrullas Firebird e Interbase 0 02-11-2004 21:01:58
Calculo con un String AMC Varios 7 14-09-2004 20:46:53
Calculo en dbgrid rmnart Firebird e Interbase 4 14-06-2004 20:29:19
Calculo de Años jrcosta75 Conexión con bases de datos 1 20-02-2004 14:27:45


La franja horaria es GMT +2. Ahora son las 12:10:07.


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