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
Akhter HUssain
720
1.3k
102.2k
Month Wise Total of QTY of ITem?
Aug 20 2019 12:46 AM
Here is my data ..
CREATE
TABLE
#ItemMasterFile(ItemCode
INT
,Descriptionitem
VARCHAR
(50),SecID
INT
,weight
int
);
CREATE
TABLE
#Probale(BID
INT
,ItemCode
INT
,prdQTY
INT
,Orderno
int
,weight
int
,Entrydate DATETIME,DelID
int
);
INSERT
INTO
#ItemMasterFile
VALUES
(1,
'A'
,1,100)
INSERT
INTO
#ItemMasterFile
VALUES
(2,
'B'
,2,100)
INSERT
INTO
#ItemMasterFile
VALUES
(3,
'C'
,3,100)
INSERT
INTO
#ItemMasterFile
VALUES
(4,
'D'
,4,100)
INSERT
INTO
#ItemMasterFile
VALUES
(5,
'e'
,5,100)
INSERT
INTO
#ItemMasterFile
VALUES
(6,
'f'
,6,100)
INSERT
INTO
#ItemMasterFile
VALUES
(7,
'g'
,4,100)
INSERT
INTO
#ItemMasterFile
VALUES
(8,
'h'
,4,100)
INSERT
INTO
#ItemMasterFile
VALUES
(9,
'K'
,2,100)
INSERT
INTO
#ItemMasterFile
VALUES
(10,
'L'
,4,100)
INSERT
INTO
#ItemMasterFile
VALUES
(11,
'M'
,2,100);
INSERT
INTO
#Probale
VALUES
(1,1,1,001,100,
'01-05-2019'
,
null
)
INSERT
INTO
#Probale
VALUES
(1,1,1,001,100,
'01-06-2019'
,
null
)
INSERT
INTO
#Probale
VALUES
(2,3,1,001,200,
'02-07-2019'
,
null
)
INSERT
INTO
#Probale
VALUES
(3,11,1,002,200,
'03-08-2019'
,
null
)
INSERT
INTO
#Probale
VALUES
(4,10,1,002,200,
'08-08-2019'
,
null
)
INSERT
INTO
#Probale
VALUES
(4,1,1,003,200,
'08-08-2019'
,
null
)
INSERT
INTO
#Probale
VALUES
(4,1,1,003,200,
'08-08-2019'
,
null
)
INSERT
INTO
#Probale
VALUES
(4,1,1,003,200,
'01-08-2019'
,
null
)
Expected Result...
S.No
Item
May-19
Jun-19
Jul-19
Aug-19
1
A
1
1
0
2
2
B
0
0
0
0
3
C
0
0
1
0
4
D
0
0
0
0
5
E
0
0
0
0
6
F
0
0
0
0
7
E
0
0
0
0
8
G
0
0
0
0
9
H
0
0
0
0
10
K
0
0
0
1
11
L
0
0
0
1
12
m
0
0
0
0
Reply
Answers (
6
)
How to disable strict_trans_table in cpanel?
trigger in SQL server