ganesh_kapase
29th November 2005, 14:16
Hi

I am getting 2 error message while compiling Program Script. Error message is
Error SQL :Illegal ORDER BY argument: tdpur045.orno
Error SQL :Illegal ORDER BY argument: tdpur045.pono

function read.main.table()
{
select tdind401.orno, tdind401.pono, tdind401.nevt,
tdind401.crmt, tdpur045.item, tdpur045.reno,
tdpur045.date, tdpur045.dqua, tdpur045.amnt,
tiitm001.dsca, tiitm001.cuni, tdpur045.srnb, tdind401.seqn
from tdind401, tdpur045, tiitm001
where tdind401._index1 inrange {tdsttr.pur, :orno.f}
and {tdsttr.pur, :orno.t}
and tdpur045._index1 = {tdind401.orno, tdind401.pono}
and tiitm001._index1 = {tdpur045.item}
and tdpur045.srnb = 1
and tdind401.seqn = 1
and tdind401.vat = tdvat.yes
order by tdpur045.orno, tdpur045.pono selectdo
if (tdind401.nevt - tdind401.crmt) > 0 then
rprt_send()
endif
endselect
}

This problem may be minor but I could not to solve the same. Please help me in this matter.

Thanx


Ganesh

george7a
29th November 2005, 14:21
Hi,

In the <order by condition>, you list one or more fields from the <select list> in the SELECT clause

http://www.baanboard.com/programmers_manual_baanerp_help_functions_database_handling_order_by

I hope it helps,

- George

bdittmar
29th November 2005, 14:22
Hi

I am getting 2 error message while compiling Program Script. Error message is
Error SQL :Illegal ORDER BY argument: tdpur045.orno
Error SQL :Illegal ORDER BY argument: tdpur045.pono

function read.main.table()
{
select tdind401.orno, tdind401.pono, tdind401.nevt,
tdind401.crmt, tdpur045.item, tdpur045.reno,
tdpur045.date, tdpur045.dqua, tdpur045.amnt,
tiitm001.dsca, tiitm001.cuni, tdpur045.srnb, tdind401.seqn
from tdind401, tdpur045, tiitm001
where tdind401._index1 inrange {tdsttr.pur, :orno.f}
and {tdsttr.pur, :orno.t}
and tdpur045._index1 = {tdind401.orno, tdind401.pono}
and tiitm001._index1 = {tdpur045.item}
and tdpur045.srnb = 1
and tdind401.seqn = 1
and tdind401.vat = tdvat.yes
order by tdpur045.orno, tdpur045.pono selectdo
if (tdind401.nevt - tdind401.crmt) > 0 then
rprt_send()
endif
endselect
}

This problem may be minor but I could not to solve the same. Please help me in this matter.

Thanx


Ganesh


Hello,

the fields are not in your select statement ?

Regards

centrino81
29th November 2005, 16:51
Hi,

Put tdpur045.orno and tdpur045.pono in your select statement and that´s all.

Regards,

mostrightfuture
29th November 2005, 17:23
Hello,

Remmember as a genereal rule, all fields in the order by clause must be in the select field list.

MRF

ganesh_kapase
30th November 2005, 05:35
Oh !! It was silly mistake done by me. Anyway thanx to all.