ctarton
8th March 2004, 11:49
I'm preparing a customized bom with crystal reports 8.5. The problem is that in the customized bom, I have standard an customized items. Is any way to put the correct description for each item (custom or standard)?
I'm using baanIVc4

Thanks in advance

gguymer
8th March 2004, 16:20
Yes, add both tipcs021 and tiitm001 and then do left outer joins from the main table item field to the tipcs021.item field and also to the tiitm001.item field. Then through the use of a formula, test each item field to see if it is null or not with the ISNULL() function. If it is not then use the info from the non-null item table.

select tipcs022.*,
tipcs021.*,
tiitm001.*
from tipcs022
where tipcs022.sitm *= tipcs021.item
and tipcs022.sitm *= tiitm001.item

if not IsNull(tipcs021.item) then
tipcs021.dsca
else if not IsNull(tiitm001.item) then
tiitm001.dsca
else
"No Description"

Gilbert Guymer
Database Administrator
Lufkin Industries, Inc.

ctarton
9th March 2004, 14:46
Thanks, it works ok. But, it is possible to have also the description of the father item?

Thanks in advance

gguymer
9th March 2004, 16:24
You need to add an extra link the the same tables for the mitm to get that. I'm assuming that you have a situation where the master item might be either custom or standard

select tipcs022.*,
tipcs021.*,
tiitm001.*,
tipcs021_a.*,
tiitm001_a.*
from tipcs022
where tipcs022.sitm *= tipcs021.item
and tipcs022.sitm *= tiitm001.item
and tipcs022.mitm *= tipcs021_a.item
and tipcs022.mitm *= tiitm001_a.item


Gilbert

ctarton
9th March 2004, 21:18
Thanks. It works fine.