TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Goran Bibic
480
2.9k
200.7k
Add to one table mssql
Jul 20 2019 11:00 AM
My code is
select x1.poslovni_partner,
CONVERT(
decimal
(16,2),(ISNULL(x1.ULR,0))) AS
'UL. roba'
,
CONVERT(
decimal
(16,2),(ISNULL(x2.ULRO, 0)))
as
'ULR. ostalo'
,
CONVERT(
decimal
(16,2),(ISNULL(x3.ULRM, 0)))
as
'UL. Repromaterijal'
,
CONVERT(
decimal
(16, 2), (ISNULL(ULR, 0) + (ISNULL(ULRO, 0) + (ISNULL(ULRM, 0)))))
as
'Saldo'
from (select poslovni_partner, sum(iznos_sa_porezom)
as
ULR from(select poslovni_partner
as
poslovni_partner, iznos_sa_porezom from dbo.mp_ulazni_racun_roba_lista where redni_broj IS NOT NULL) a group by poslovni_partner)
as
x1 JOIN
(select poslovni_partner, sum(iznos_sa_porezom)
as
ULRO from (select poslovni_partner
as
poslovni_partner,iznos_sa_porezom from dbo.mp_ulazni_racun_ostalo_lista where redni_broj IS NOT NULL) b group by poslovni_partner)
as
x2 on x1.poslovni_partner = x2.poslovni_partner JOIN
(select poslovni_partner, sum(iznos_sa_porezom)
as
ULRM from (select poslovni_partner
as
poslovni_partner,iznos_sa_porezom from dbo.mp_ulazni_racun_repromaterijal_lista where redni_broj IS NOT NULL) b group by poslovni_partner)
as
x3 on x1.poslovni_partner = x3.poslovni_partner
Result is
poslovni_partner UL. roba ULR. ostalo UL. Repromaterijal Saldo
MOZZART DOO 630.20 93.60 292.50 1016.30
poslovni_partner is bussines partner on english
Need for all partners in this 3 tables.
Result is IF have partners in all tables...if not exist i one of tables dont show him...
If not exist in one table need to show 0.00
some help please?
Reply
Answers (
2
)
Order status Report ?
Report req Sum of Sales order qty and daily produce quantity