mrreds
12th September 2010, 17:55
Hi,

How can I validate two dates?

The first date is today using date.num, but it is retrieving 6 chars

The second one is coming from a SQL.

I need to validate the vigency of a line BOM according Effective Date (tibom010.t$indt) and Expery Date (tibom010.t$exdt)


todaydate = date.num()

select *
from tibom010
where
tibom010.mitm = :tcibd001.item
and todaydate > t$indt
and todaydate < t$exdt


I think that the SQL logic is okay, but date.num() has 6 chars and t$indt has 10 chars.

How can I include the time in my validation?

1197612000 vs 734027

bdittmar
12th September 2010, 19:12
Hi,

How can I validate two dates?

The first date is today using date.num, but it is retrieving 6 chars

The second one is coming from a SQL.

I need to validate the vigency of a line BOM according Effective Date (tibom010.t$indt) and Expery Date (tibom010.t$exdt)


todaydate = date.num()

select *
from tibom010
where
tibom010.mitm = :tcibd001.item
and todaydate > t$indt
and todaydate < t$exdt


I think that the SQL logic is okay, but date.num() has 6 chars and t$indt has 10 chars.

How can I include the time in my validation?

1197612000 vs 734027

Hello,

check the bom component validation with:

and (tibom010.indt <= date.num() and (tibom010.exdt > date.num()
or tibom010.exdt = 0))

Regards

ARijke
13th September 2010, 09:45
Use utc.num() instead of date.num().

tibom010.indt/exdt do have the UTC Date data type.

Now you are comparing number of days since 0000/1/1 against number of seconds since 1970/1/1.