Hi,
I need help in getting this type of output:
Create table T1
(Id int identity primary key,
VoucherNo varchar(10),
TransNo varchar(10)
)
Insert into T1 values ('V100','Trns1'),('V101','Trns1'),('V102','Trns1'),('V103','Trns1'),('V104','Trns1'),('V106','Trns1')
Resultant output:
TransNo FirsvoucherNo LastVoucherNo Quantity
trans1 V100 V104 5
trans1 V106 V106 1
I need help in getting this type of output:
Create table T1
(Id int identity primary key,
VoucherNo varchar(10),
TransNo varchar(10)
)
Insert into T1 values ('V100','Trns1'),('V101','Trns1'),('V102','Trns1'),('V103','Trns1'),('V104','Trns1'),('V106','Trns1')
Resultant output:
TransNo FirsvoucherNo LastVoucherNo Quantity
trans1 V100 V104 5
trans1 V106 V106 1
Please Mark as Answer if my post works for you or Vote as Helpful if it helps you. Kapil Singh