smusba
11th June 2008, 11:54
Dear Gurus,
I am facing an initialisation problem in program flow. The program works perfectly if the order date is given of different range but fails to get the correct data if order date is of same range. I had tried very much to solve but the problem still exists. Does anyone have any ideas for fixing this?
Here is my code(Script)
functions:
function read.main.table()
{ dramnt=0.0
ddat=date.num()
if etol(reg) = 1 then
cuno.f = " CG401"
cuno.t = " CG499"
select tdsls041.*
from tdsls041
where tdsls041.odat between :ddat.f and :ddat.t
and tdsls041.cuno between :cuno.f and :cuno.t
|and tdsls041.odat between :ddat.f and :ddat.t
|order by tdsls041.odat,tdsls041.cuno
selectdo
select tdsls040.*
from tdsls040
where tdsls040.orno = :tdsls041.orno
and tdsls040.odat = :tdsls041.odat
|and tdsls045.cuno = :tdsls040.cuno
selectdo
cuno = tdsls041.cuno
if ddat = tdsls040.odat then
dramnt = dramnt+ tdsls041.amta
else
dramnt = 0.0
endif
ddat = tdsls041.odat
select tccom010.*
from tccom010
where tccom010.cuno = :tdsls041.cuno
selectdo
endselect
rprt_send()
endselect
endselect
endif
}
Suhaib
I am facing an initialisation problem in program flow. The program works perfectly if the order date is given of different range but fails to get the correct data if order date is of same range. I had tried very much to solve but the problem still exists. Does anyone have any ideas for fixing this?
Here is my code(Script)
functions:
function read.main.table()
{ dramnt=0.0
ddat=date.num()
if etol(reg) = 1 then
cuno.f = " CG401"
cuno.t = " CG499"
select tdsls041.*
from tdsls041
where tdsls041.odat between :ddat.f and :ddat.t
and tdsls041.cuno between :cuno.f and :cuno.t
|and tdsls041.odat between :ddat.f and :ddat.t
|order by tdsls041.odat,tdsls041.cuno
selectdo
select tdsls040.*
from tdsls040
where tdsls040.orno = :tdsls041.orno
and tdsls040.odat = :tdsls041.odat
|and tdsls045.cuno = :tdsls040.cuno
selectdo
cuno = tdsls041.cuno
if ddat = tdsls040.odat then
dramnt = dramnt+ tdsls041.amta
else
dramnt = 0.0
endif
ddat = tdsls041.odat
select tccom010.*
from tccom010
where tccom010.cuno = :tdsls041.cuno
selectdo
endselect
rprt_send()
endselect
endselect
endif
}
Suhaib