Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Bases de datos > MySQL
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 24-08-2007
juangabriel1786 juangabriel1786 is offline
Miembro
 
Registrado: ene 2006
Posts: 38
Poder: 0
juangabriel1786 Va por buen camino
Unhappy Seleccionar el ultimo registro de un campo

Hola soy nuevo en esto, y me gustaria que me alludaran, me gustaria seleccionar el ultimo campo de un registro de una tabla y almacenarla en una variable, please ayudenme...
Responder Con Cita
  #2  
Antiguo 24-08-2007
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Poder: 25
Caral Va por buen camino
Hola
Código Delphi [-]
var
 x: String;
begin
MyQuery.sql.text:= 'Sellect last (TuTable.TuCampo) as TuNombre From TuTabla';
 x:= MyQuery.Fields[0].AsString;
end;
saludos
__________________
Siempre Novato
Responder Con Cita
  #3  
Antiguo 25-08-2007
sexshop_3 sexshop_3 is offline
Baneado
 
Registrado: nov 2006
Posts: 18
Poder: 0
sexshop_3 Va por buen camino
Smile

SI ESTAS USANDO UN Ttable:

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
var nombre:string
begin
    table.last;
    nombre:=table.fieldbyname('clave').asstring;
end;

DONDE 'clave' ES EL NOMBRE DEL CAMPO DEL QUE QUIERES SACAR LOS DATOS
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
No guarda el ultimo registro Tecnic2 Conexión con bases de datos 3 01-09-2004 19:31:23
Código del último registro guardado quade MySQL 1 03-06-2004 16:20:44
Ultimo registro ander Firebird e Interbase 3 18-03-2004 14:52:02
Obtener el último registro juanchi Conexión con bases de datos 2 06-02-2004 01:52:21
Ir al último registro de una tabla fortran Tablas planas 6 05-09-2003 16:36:02


La franja horaria es GMT +2. Ahora son las 05:55:20.


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