IndoTech
15th July 2016, 15:56
Hi

want to select all records for a warehouse from whwmd215

The following select query not working i.e. not entering the selectdo part

domain tccwar t.cwar
t.cwar = "PT419 "

select whwmd215.*
from whwmd215
where whwmd215.cwar = :t.cwar
and whwmd215.qhnd <> 0
order by whwmd215._index1
selectdo

endselect

but if we remove the "whwmd215.cwar = :t.cwar" and make it like below then working fine...pls. help


select whwmd215.*
from whwmd215
where whwmd215.qhnd <> 0
order by whwmd215._index1
selectdo

endselect

Regards
Kedar

mark_h
15th July 2016, 23:53
Confirm that he warehouse is "PT419 " - note there is a space after the warehouse. So not an ln baan user so I do not know if it is right or left justified. So once you confirm the warehouse is correct - run your query without whwmd215.qhnd <> 0 and make sure you get records. I assume that is quantity on hand and I am assuming there is at least one record in that warehouse where the quantity on hand is greater than 0. Not really sure you would have a negative on hand quantity but anything is possible with baan.

Maria Anto
16th July 2016, 09:46
Hello,
The query when checked with other warehouses is working fine.you can trim the value of t.cwar before assigning and check with a message... :)

Ajesh
17th July 2016, 14:35
Assuming that there is a record like that..

That trailing space in t.cwar seems to be the problem..just try removing it by using..strip$(t.cwar) and then using it in the query...