hai all…
I want tu union 2 tables in 1 form
like this sql syntax
→
SELECT *
FROM [Table1]
UNION
SELECT *
FROM [Table2]
I want to union tabel 17 (GL Entry) and table 81 (general journal line)
how could i do that?
thanks
hai all…
I want tu union 2 tables in 1 form
like this sql syntax
→
SELECT *
FROM [Table1]
UNION
SELECT *
FROM [Table2]
I want to union tabel 17 (GL Entry) and table 81 (general journal line)
how could i do that?
thanks
I mean,it’s not just for 1 form
but in 1 table box , it contains data from 2 tables (with the same columns)
THe UNION query only works if both tables have the same structure! Thus, a "SELECT *" with T17 UNION T81 cannot work. So maybe you could just select some of the fields …
PLease refer to the “Books Online” for further details about UNION.
Stan what are you trying to do?
in chart of account form there is field net change that if we click the drill down, it showed from table 17
so I want to showed every transaction from table 17 (Posted) and table 81 (not posted) for every same document no
and then from the 2 tables, i want to SUM the amount
is that possible to do that?
Actually i want to show those 2 tables like this
SELECT ‘17’ As [Table No],[G_L Account No_],[Document No_],Amount
FROM [Company$G_L Entry]
UNION
SELECT ‘81’ As [Table No],[Account No_],[Document No_],[Amount (LCY)]
FROM [Company$Gen_ Journal Line]
Hi Stan,
I am still not really sure what you want to accomplish, but here is an example of how you might achieve what you want. The basis of it is that you create a view on SQL Server and that in NAV you create a table that is based on and linked to this view. The example uses an INNER JOIN for the Customer and the Detailed Cust. Ledg. Entry tables.
So …
Ready!
Now if you run this table you will see it already ‘contains’ data. Well, actuallu not as it is showing you the data through the SQl Server view.
Hope this can help you.
BTW1: just did a search on SQL+View: it shows (a.o.) some valuable postings on this topic
BTW2: you even can edit the data thorugh this table, so you might ask yourself if that is wanted …