Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #3  
Antiguo 21-10-2011
Vales08 Vales08 is offline
Miembro
NULL
 
Registrado: feb 2011
Posts: 133
Poder: 16
Vales08 Va por buen camino
Me disculpo por el error, aca les pongo bien el codigo, no me habia dado cuenta de que se me borro la ultima parte:

Código Delphi [-]
        var
          Proximafecha, UltimoDia, DiaActual:TdateTime;
          hoy:integer;
          dia, mes, anio: Word;

         ...
        hoy:=DayOfTheWeek(Date); // guardo el dia de la semana en el que se ubica la fecha actual
        DecodeDate(Now, anio, mes, dia);
        UltimoDia:=RecodeDate(Date, anio, mes, DaysInMonth(Now));
        // lo que realice aqui es guardar en la variable 'UltimoDia' el ultimo dia del mes

        for Proximafecha:=Now to UltimoDia do    (**)
          begin
                if  hoy=1 then   // Lunes
                  begin
                    DM.DSET_agen_turFECHA.Value:=Now; //Guardo la fecha en la tabla AGENDA
                  end;
                if  hoy=2 then   // Martes
                  begin
                    ProximaFecha:=IncDay(Date,6);
                    DM.DSET_agen_turFECHA.Value:=Proximafecha;
                  end;
                if  hoy=3 then   // Miercoles
                  begin
                    ProximaFecha:=IncDay(Date,5);
                    DM.DSET_agen_turFECHA.Value:=ProximaFecha;
                  end;
                if  hoy=4 then   // Jueves
                  begin
                    ProximaFecha:=IncDay(Date,4);
                    DM.DSET_agen_turFECHA.Value:=Proximafecha;
                  end;
                if  hoy=5 then   // Viernes
                  begin
                    ProximaFecha:=IncDay(Date,3);
                    DM.DSET_agen_turFECHA.Value:=Proximafecha;
                  end;
                if  hoy=6 then   // Sabado
                  begin
                    ProximaFecha:=IncDay(Date,2);
                    DM.DSET_agen_turFECHA.Value:=Proximafecha;
                  end;
                if  hoy=7 then   // Domingo
                  begin
                    ProximaFecha:=IncDay(Date,1);
                    DM.DSET_agen_turFECHA.Value:=Proximafecha;
                  end;
          end;

Gracias.
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

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
bucle para fechas de pagos chino150 Varios 5 19-05-2008 15:01:28
Bucle for de 2 en 2 douglas OOP 9 17-10-2007 15:55:53
bucle for utilizando fechas barrauda Varios 3 01-02-2007 17:28:49
bucle dentro de un bucle Cosgaya Varios 2 06-06-2005 07:05:16
¿Realizar una busqueda de fechas? judoboy SQL 4 23-05-2003 23:26:53


La franja horaria es GMT +2. Ahora son las 14:32:15.


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