Pesquisar na Comunidade
Mostrando resultados para as tags ''mês''.
Encontrado 3 registros
-
Preciso de um codigo que funcionaria da seguinte forma quando iniciasse o mês o codigo iniciaria como "mmyyy" - cod ex: 082016 - 001 082016 - 002 082016 - 00........... 082016 - 060...... ai quando chegar o outro mes o codigo iniciaria novamente do 1 e não 082016 - 061 o certo seria ex: 092016 - 001 txt_codigo = Format(Now, "yyyymm") & " - " & Range("A60000").End(xlUp).Offset(0, 0).Value, "000"
-
Caros amigos, estou com uma duvida para gerar um script. O intuito é somar os horario de todos os dias da semana. Mas só consigo fazer para a primeira semana, Podem me ajudar. abaixo meu script. Caros amigos, estou com uma duvida para gerar um script. O intuito é somar os horário de todos os dias da semana. Mas só consigo fazer para a primeira semana, Podem me ajudar. abaixo meu script. select agen.short_desc as nome_agenda_curto, agen.agenda_key as codigo_da_agenda, agesch.agenda_schedule_key as codigo_horario, case when agesch.monday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else null end as monday_2, case when agesch.tuesday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else null end as tuesday_2, case when agesch.wednesday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else null end as wednesday_2, case when agesch.thursday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else null end as thursday_2, case when agesch.sunday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else null end as sunday_2, case when agesch.saturday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else null end as saturday_2, case when agesch.friday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else null end as friday_2, --SOMANDO case when agesch.monday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.tuesday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.wednesday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.thursday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.sunday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.saturday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.friday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end as TOTAL, ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) as TEMPO_HORARIO, case when agesch.monday then ((to_timestamp(to_char(agelock.final_date_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agelock.init_date_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.tuesday then ((to_timestamp(to_char(agelock.final_date_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agelock.init_date_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.wednesday then ((to_timestamp(to_char(agelock.final_date_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agelock.init_date_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.thursday then ((to_timestamp(to_char(agelock.final_date_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agelock.init_date_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.sunday then ((to_timestamp(to_char(agelock.final_date_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agelock.init_date_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.saturday then ((to_timestamp(to_char(agelock.final_date_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agelock.init_date_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.friday then ((to_timestamp(to_char(agelock.final_date_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agelock.init_date_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end as TOTAL_BLOCK, -- (TOTAL_HORARIO - TOTAL_BLOCK) CASE WHEN agelock.agenda_schedule_key=agesch.agenda_schedule_key then( ((case when agesch.monday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.tuesday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.wednesday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.thursday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.sunday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.saturday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.friday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end)- (case when agesch.monday then ((to_timestamp(to_char(agelock.final_date_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agelock.init_date_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.tuesday then ((to_timestamp(to_char(agelock.final_date_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agelock.init_date_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.wednesday then ((to_timestamp(to_char(agelock.final_date_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agelock.init_date_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.thursday then ((to_timestamp(to_char(agelock.final_date_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agelock.init_date_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.sunday then ((to_timestamp(to_char(agelock.final_date_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agelock.init_date_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.saturday then ((to_timestamp(to_char(agelock.final_date_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agelock.init_date_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.friday then ((to_timestamp(to_char(agelock.final_date_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agelock.init_date_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end )) )else (case when agesch.monday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.tuesday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.wednesday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.thursday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.sunday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.saturday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end + case when agesch.friday then ((to_timestamp(to_char(agesch.final_time,'HH24:MI:SS'),'HH24:MI:SS')) - to_timestamp(to_char(agesch.init_time,'HH24:MI:SS'),'HH24:MI:SS')) else '00:00:00' end ) end as DISPONIVEL_AGENDAMENTO from health_kernel.agenda agen join health_kernel.agenda_schedule agesch on (agesch.agenda_key=agen.agenda_key) left join health_kernel.agenda_schedule_lock agelock on (agelock.agenda_schedule_key=agesch.agenda_schedule_key) where agen.deleted = false and agesch.deleted = false and agesch.init_date between '2016-04-01' and '2016-04-30' and agesch.final_date between '2016-04-01' and '2016-04-30' group by agelock.agenda_schedule_key, agen.short_desc , agen.agenda_key, agesch.agenda_schedule_key, agelock.final_date_time, agelock.init_date_time;
-
Este programa usa funções de bibliotecas padrões para validar a data atual, dica muito boa para os iniciantes em Linguagem C. Veja abaixo imagens do programa em execução: http://4.bp.blogspot.com/-JjerAbl8GVA/Ves1Lsln-eI/AAAAAAAACW8/jfekv3dHic4/s1600/dte.PNG http://2.bp.blogspot.com/-qp1zcoyKfQA/Ves23PdLPcI/AAAAAAAACXM/lvdRRvYX6dw/s1600/deat.PNG Veja abaixo o link do código do programa: http://codigosfontes-ccplus-plus.blogspot.com.br/2015/09/validando-data-atual.html