yogesh kapil
5th September 2012, 13:58
how do i match two date from two different table without considering time for two date. the date format is tcdate for both the table.


select whina113.*
from whina113
where whina113.item=:hold.item
and whina113.trdt=:tdsls406.dldt
and whina113.cwar=:tdsls401.cwar


i want to run this query. Can sombody help me.

Mario
7th September 2012, 11:40
hi,

domain tcdate trdt, dldt
long yearno,monthno,month_dayno, dum

utc.to.date(whina113.trdt, yearno, monthno, month_dayno, dum, dum, dum)
trdt = date.to.utc(yearno, monthno, month_dayno, 0,0,0)

utc.to.date(tdsls406.dldt, yearno, monthno, month_dayno, dum, dum, dum)
dldt = date.to.utc(yearno, monthno, month_dayno, 0,0,0)

Now trdt and dldt will all have the sime time hh:mm:ss and you can check on the date.

if trdt = dldt then
...
endif



See programguide for the help on these functions.

Groetjes