tbrault
13th March 2003, 12:21
i wants create a report turnover / sell orders.
To do that, i use this query :
select tdsls045.orno, tdsls045.amnt, tdsls045.odam
from tdsls045

now, i want a field "tdsls045.amnt - tdsls045.odam", and i want sort my layouts with this field.

How can I do that?
Help, me i am a new programmer with sql

morpheus
13th March 2003, 12:41
Calculate the difference and store the value in a variable, in the program script itself. In the report layout, sort this variable as per your requirement.
Hope this helps.

tbrault
13th March 2003, 12:48
hum???? Yeah but, when I say I am new with sql programming, I'm a really novice. ;)
Can you explain me more please. An example can help me.

morpheus
13th March 2003, 12:56
extern domain tcqsl1 diff

{
select tdsls045.orno, tdsls045.amnt, tdsls045.odam
from tdsls045
where <condition>
selectdo
diff = (tdsls045.amnt - tdsls045.odam)
rprt_send()
endselect
}

tbrault
13th March 2003, 13:30
Where, in the script, I must copy this sql?

tbrault
13th March 2003, 15:57
how can I sort this calculated field?