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
Revathi Parvathi
NA
323
64.2k
SQL query
Dec 13 2017 2:11 AM
Hi,
I got the below-mentioned output based on the query.I want to show only one Tammy Hanson and sum of Commission paid for this .Is it posible.Please any one help me.
output and query:
Vendor
Date
of
Last
Check
Date
of
check
for
month
Amount
Sales Rep
Commission
Boston Warehouse 12/12/2017 12/12/2017 919.00
NULL
Tammy Hanson 183.80
Woodlink 12/12/2017 12/12/2017 979.86
NULL
Tammy Hanson 195.97
SELECT
Vendor,
CASE
WHEN
CONVERT
(
varchar
(50), DateModified, 101)=
'01/01/1900'
THEN
''
ELSE
CONVERT
(
varchar
(50), DateModified, 101)
end
as
'Date of Last Check'
,
CASE
WHEN
CONVERT
(
varchar
(50), PaycommissionDate, 101)=
'01/01/1900'
THEN
''
ELSE
CONVERT
(
varchar
(50), PaycommissionDate, 101)
end
AS
'Date of check for month'
,
SUM
([Original $ Total])
'Amount'
,
NULL
,[Sales Rep],
SUM
([Commission $ paid])
'Commission $ paid'
from
Tbl_Commission_Reconcilation
where
Vendor
is
not
null
and
Month
([
Order
Date
])=
MONTH
(Getdate())
group
by
Tbl_Commission_Reconcilation.Vendor,
CONVERT
(
varchar
(50), DateModified, 101),[Sales Rep],PaycommissionDate
Reply
Answers (
3
)
How to compare two query result and create one dynamic colum
.net core 2.0 Invoice Master and Invoice details samplecode