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
Jes Sie
743
1.2k
284.8k
Aging of Accounts in SQL SERVER
May 30 2018 1:31 AM
I need help from DBA's and from those who got a better knowledge of SQL SERVER.
I need to produce an aging of accounts. Below is my query and its result:
select
SUM
(e.TotalPremium)
AS
[SOLD POLICY],
CASE
WHEN
DATEDIFF(D, e.DateIssued, getdate()) <= 30
THEN
'30 Days'
WHEN
DATEDIFF(D, e.DateIssued, getdate()) <= 60
THEN
'60 Days'
WHEN
DATEDIFF(D, e.DateIssued, getdate()) <= 90
THEN
'90 Days'
ELSE
'Above 90 days'
END
as
AGING
from
tblMotorInsurance_eCI e
where
e.AgentID=
'16-113-01'
and
e.Remarks <>
'Cancel'
and
e.IsPaid =
'false'
group
by
e.DateIssued
As you can see from the result, I need to group them according to aging of accounts. Any help is really appreciated.
Reply
Answers (
2
)
Calling report in asp.net core 2.0 ntlm error
USING “VAR” NEEDLESSLY WHEN YOU KNOW THE DATA TYPE