Fórum Calculo de hora x turno em tabela #277979

19/04/2005

0

Pessoal, Tenho uma tabela que salva, em tempo determinado, dentre outros campos, tem hora e turno. A hora é automatica, mas o turno
não estou conseguindo. Ex:
6:00 as 14:00 = turno 1
14:00 as 22:00 = turno 2
22:00 as 6:00 = turno 3

Preciso colocar o turno no campo turno automaticamente, igual
a tabela acima.

Grato
juarezber@terra.com.br


Juarezber

Juarezber

Responder

Posts

19/04/2005

Edilcimar

if (hora>=horax) and (hora <= horay) then
turno := turnodesejado


Responder

Gostei + 0

19/04/2005

Juarezber

Amigo, fico agradecido se for mais detalhado

Grato
Juarez


Responder

Gostei + 0

19/04/2005

Rjun

if (hora >= 6) and (hora <= 14) then
  turno = 1
else if (hora >= 14) and (hora <= 22) then
  turno = 2
else
  turno = 3;



Responder

Gostei + 0

01/05/2017

Joao

[code:1:62cb2e382c]
if (hora >= 6) and (hora <= 14) then
turno = 1
else if (hora >= 14) and (hora <= 22) then
turno = 2
else
turno = 3;
[/code:1:62cb2e382c]





MAIS NESSE CASO SE EU COLOCAR TIPO 25 O TURNO VAI SER A NOITE E AS HORAS É ATE 24, CORRETO
Responder

Gostei + 0

01/05/2017

Joao

program Turnos_Horarios;

{$APPTYPE CONSOLE}

uses
SysUtils;
Var Entrada:Real;

begin
Writeln('HORARIOS DE TURNOS');
Writeln('');
Writeln('Hora de Entrada de Funcionarios');
Readln(Entrada);


If Entrada = 6 Then
Begin
Writeln( 'TURNO 1 ');
Readln;
End;
If Entrada = 14 Then
Begin
Writeln('TURNO 2');
Readln;
End;
if (Entrada = 22)Then
Begin
Writeln('TURNO 3');
Readln;
end

Else If Entrada > 24 Then
Begin
Writeln('HORARIO INVALIDO');
Readln;
End

Else
Begin
Writeln('ENTRADA FORA DO PERMITIDO');
Writeln(' PROCURE SEU GERENTE');
Readln;
End;
end.

//ESPERO TER AJUDADO...
Responder

Gostei + 0

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar