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
Manish Patat
1.7k
68
7.6k
SQl Query Pivot table
Oct 13 2020 1:45 AM
This is my Query :-
SELECT
isnull
(
cast
(
year
as
varchar
(25)),0)
AS
Year
,
isnull
(
cast
(January
as
varchar
(25)),0)
AS
January,
isnull
(
cast
(February
as
varchar
(25)),0)
AS
February,
isnull
(
cast
(March
as
varchar
(25)),0)
AS
March,
isnull
(
cast
(April
as
varchar
(25)),0)
AS
April,
isnull
(
cast
(May
as
varchar
(25)),0)
AS
May,
isnull
(
cast
(June
as
varchar
(25)),0)
AS
June,
isnull
(
cast
(July
as
varchar
(25)),0)
AS
July,
isnull
(
cast
(August
as
varchar
(25)),0)
AS
August,
isnull
(
cast
(September
as
varchar
(25)),0)
AS
September,
isnull
(
cast
(October
as
varchar
(25)),0)
AS
October,
isnull
(
cast
(November
as
varchar
(25)),0)
AS
November,
isnull
(
cast
(December
as
varchar
(25)),0)
AS
December,
isnull
(January,0)+
ISNULL
(February,0)+
ISNULL
(March,0)+
ISNULL
(April,0)+
ISNULL
(May,0)+
ISNULL
(June,0)+
ISNULL
(July,0)+
ISNULL
(August,0)+
ISNULL
(September,0)+
ISNULL
(October,0)+
ISNULL
(November,0)+
ISNULL
(December,0)
As
'Total Weight'
FROM
orderbookingdispatchmwise
PIVOT (
SUM
(weight)
FOR
month
IN
([January], [February], [March], [April], [May], [June], [July], [August], [September], [October], [November], [December]))
AS
PVTTable
ORDER
BY
year
DESC
My Output
On this Query Output All Year And Month Data Show
But I Have Show Only Current Month And year Greater Than Data
my required Output Like..
How to Possible
Thank in advance ...
Reply
Answers (
3
)
Access - compare two tables and update or insert data in first table
Is it possible to insert data in DataBase through View.