suhas-mahajan
3rd February 2003, 07:58
Dear All,
I have two different problems related to Double data type, i.e. comparing doubles and grouping doubles, my requirement is some what specific so I want to make it. When I group <see first query> pric field, it will not give error but in the output it shows duplicate values. In the second query, it shows "No data within selection", I tried greater than and less than funda as well as double.comp function but problem not yet solved, any help appreciable. Might be it is related to my tcpric properties problem. I have BaaN IV C4 with SP10.

1.> select tdpur041.suno, tdpur041.item, tdpur041.pric,
tdpur041.cuqp, tdpur041.orno, tdpur041.oqua
from tdpur041
where tdpur041.suno between :suno.f and :suno.t
and tdpur041.ddtb between :date.f and :date.t
group by tdpur041.suno, tdpur041.item, tdpur041.pric,
tdpur041.cuqp, tdpur041.orno, tdpur041.oqua
order by tdpur041.suno, tdpur041.item,tdpur041.pric,
tdpur041.cuqp, tdpur041.orno, tdpur041.oqua
selectdo
....
....
endselect

2.> select tdsls045.*
from tdsls045
where tdsls045.cuno = :cuno.f
and tdsls045.item = :item.f
and tdsls045.invd between :date.f and :date.t
and tdsls045.ttyp = "EXC"
and tdsls045.pric = :pric
order by tdsls045.invn
selectdo
....
....
endselect

Waiting for immediate reply.

-Suhas

OmeLuuk
3rd February 2003, 11:00
group by tdpur041.suno, tdpur041.item, tdpur041.pric,
tdpur041.cuqp, tdpur041.orno, tdpur041.oqua
order by tdpur041.suno, tdpur041.item,tdpur041.pric,
tdpur041.cuqp, tdpur041.orno, tdpur041.oquaWhy order by and group by? See description of group by (http://www.baanboard.com/programmers_manual_baanerp_help_functions_database_handling_group_by) and order by (http://www.baanboard.com/programmers_manual_baanerp_help_functions_database_handling_order_by).

askajale
3rd February 2003, 19:56
Hi Suhas

I think regarding your first query, can you try selecting tdpur041.pono in select / group by / order by statements?

It seems like for the Supplier - Item - Order - UOM - Qty, there are multiple lines in the same PO with all these details same.. so mostly it will solve by including the PONO field.

Regarding second query,

1. check the domain of "pric" variable (Form / Program variable), it has to be same as that of your database field.

2. In your where clause you are trying to equate the database field value with Screen field of "From" and hope you are giving the exact value for this field on screen (and not domain min / max value)

Hope this may help you..!

-- Avinash

suhas-mahajan
7th February 2003, 11:03
Dear OmeLuuk / askajale,

Forget my queries, please give me tested examples of grouping and comparing double data type, I think that is enough for me.

-Suhas