Crystal Report - FORMATO-FECHA

 
Vista:

FORMATO-FECHA

Publicado por ISABEL (4 intervenciones) el 25/06/2004 00:04:26
HOLA, ALGUIEN SABE SI EXISTE UNA FUNCIÓN DE CRYSTAL QUE ME DEVUELVA EL ÚLTIMO DÍA DEL MES....POR EJEMPLO...QUE ME DEVUELVA EL VALOR 31 PARA ENERO, 28 O 29 PARA FEBRERO, ETC..

GRACIAS.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:FORMATO-FECHA

Publicado por jorge Guzman (10 intervenciones) el 05/01/2007 03:40:59
bueno yo utilizo para años bisiestos lo siguiente
If {Comando.bo_mes} = 01 or {Comando.bo_mes} = 03
or {Comando.bo_mes} = 05 or {Comando.bo_mes} = 07
or {Comando.bo_mes} = 08 or {Comando.bo_mes} = 10
or {Comando.bo_mes} = 12
then 31

Else If
{Comando.bo_mes} = 04 or {Comando.bo_mes} = 06 or
{Comando.bo_mes} = 09 or {Comando.bo_mes} = 11
then 30

Else If
{Comando.bo_mes} = 02 and
(Remainder ({Comando.bo_year}, 4) = 0 and Remainder({Comando.bo_year}, 100) <> 0) or
(Remainder ({Comando.bo_year}, 400) = 0) then 29
else 28
YA QUE COMANDO.BO_MES ME DEVUELVE EL NUMERO DE MES SEGUN MI BASE DE DATOS
O LO PUEDES HACER DE LA SIGUIENTE MANERA:

If
Month({Orders.Order Date}) = 01 or Month({Orders.Order Date}) = 03 or
Month({Orders.Order Date}) = 05 or Month({Orders.Order Date}) = 07 or
Month({Orders.Order Date}) = 08 or Month({Orders.Order Date}) = 10 or
Month({Orders.Order Date}) = 12
then 31
Else If
Month({Orders.Order Date}) = 04 or Month({Orders.Order Date}) = 06 or
Month({Orders.Order Date}) = 09 or Month({Orders.Order Date}) = 11
then 30
Else If
Month({Orders.Order Date}) = 02 and
(Remainder(Year({Orders.Order Date}), 4) = 0 and Remainder(Year({Orders.Order Date}), 100) <> 0) or
(Remainder(Year({Orders.Order Date}), 400) = 0) then 29
else 28
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar