learner
21st September 2004, 09:41
Hello,
I would like to write a dynamic sql , where by if my user fills Sales Tax code on the form then first query will get executed otherwise if he fills both i.e State Code and Sales Tax Code on the form then the second query will be executed. I read the help for sql functions, but could not understand how do i achieve this.
|select supplier Localisation table in case State Code is filled
select tdind012.*
from tdind012
where tdind012._index1 = {:tiitm001.suno}
and tdind012.scty = :state.code
selectdo
endselect
|select supplier Localisation table in case State Code and Sales Tax Code is filled
select tdind012.*
from tdind012
where tdind012._index1 = {:tiitm001.suno}
and tdind012.scty = :state.code
and tdind012.svat = :sales.tax.code
selectdo
endselect
Waiting for your replies gurus.
Regards
Learner
I would like to write a dynamic sql , where by if my user fills Sales Tax code on the form then first query will get executed otherwise if he fills both i.e State Code and Sales Tax Code on the form then the second query will be executed. I read the help for sql functions, but could not understand how do i achieve this.
|select supplier Localisation table in case State Code is filled
select tdind012.*
from tdind012
where tdind012._index1 = {:tiitm001.suno}
and tdind012.scty = :state.code
selectdo
endselect
|select supplier Localisation table in case State Code and Sales Tax Code is filled
select tdind012.*
from tdind012
where tdind012._index1 = {:tiitm001.suno}
and tdind012.scty = :state.code
and tdind012.svat = :sales.tax.code
selectdo
endselect
Waiting for your replies gurus.
Regards
Learner