c0rowe
9th June 2011, 14:17
Hi,

Hope you knowledgeable people can help me.

We use Baan IV, I'm using MS Query to pull data for custom reporting.

My background is zero when it comes to these things, so I'm learning as I go along.

So far I'm fine at creating reports coming from a single table.

Now I need to join two tables, ttfgld106 & ttfgld410. My motive is because we need to see data by transaction (table106) with supplier numbers, and Purchase Order numbers (table410).

Here is what I have so far:

SELECT * from ttfgld106100
left outer join ttfgld410100 on
(ttfgld106100.t_otyp = ttfgld410100.t_ttyp
and ttfgld106100.t_odoc = ttfgld410100.t_docn
and ttfgld106100.t_fyer = ttfgld410100.t_fyer
and ttfgld106100.t_fprd = ttfgld410100.t_fprd
and ttfgld106100.t_ocmp = ttfgld410100.t_ocom
and ttfgld106100.t_leac = ttfgld410100.t_leac)

This is almost exactly what I need, apart from it is creating duplicates because ttfgld410.t_line does not tie up with anything in ttfgld106. ttfglf106.t_olin and ttfgld410.t_lino match up perfectly.

Can you help please? Is there a way of excluding ttfgld410.t_line?

Feel free to tear this apart, if I'm going in the wrong direction, I will not be offended as I'm completely out of my comfort zone with this. (although I do find it fascinating)

Thanks in advance.

Chris

hunehoek
17th June 2011, 14:46
Chris,

I have already made several queries, but I don't use tfgld410. When I need to use information about our suppliers, I use table tccom021.
t_suno is both in tccom021 and in tables with financial things (eg. tfgld102 and 106).

Erik