Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Calculating Percentage on data and showing output

Author  Topic 

Mario Noronha
Starting Member

6 Posts

Posted - 2010-06-30 : 05:46:37
select CONVERT(VARCHAR(10),LastChangedON_UTC,101) as Date,LOB,
ApplicationOwnerConfirmation
from dtp_p2.InventoryMainExport where ApplicationOwnerConfirmation ='Validated'

the table which is generated by the query is as follows :

Date LOB ApplicationOwnerConfirmation
6/11/2010 GTIS Validated
4/15/2010 GCS Validated
5/11/2010 GCS Validated
4/15/2010 GCS Validated
4/26/2010 GCS Validated
6/11/2010 GTIS Validated
4/15/2010 GCS Validated
4/15/2010 GCS Validated
4/15/2010 GCS Validated
4/15/2010 GCS Validated
4/15/2010 GCS Validated
4/26/2010 GCS Validated
6/11/2010 GTIS Validated
6/11/2010 GTIS Validated
6/11/2010 GTIS Validated
6/14/2010 GTIS Validated
4/26/2010 GCS Validated
6/4/2010 GCS Validated
4/15/2010 GCF Validated
4/15/2010 GCF Validated
4/15/2010 GCS Validated
6/4/2010 GCS Validated
6/11/2010 GTIS Validated
6/4/2010 GCS Validated
4/26/2010 GCS Validated
4/15/2010 GCS Validated
4/15/2010 GCF Validated
4/15/2010 GCS Validated
6/11/2010 GTIS Validated


i want to calculate the percentage by LOB on for each date that is Listed in the table for that LOB

Desired Sample Ouput % on weekly basis By LOB
date GCF GCS GTIS
24-03-2010 1 0 1
31-03-2010 2 0 3
04-10-2010 3 0 4
14-04-2010 6 0 9
21-04-2010 7 0 10
28-04-2010 9 0 13
05-05-2010 10 1 15

can anyone help me please

Thanks
Mario Noronha

Sachin.Nand

2937 Posts

Posted - 2010-06-30 : 05:59:30
The image you posted is not visible.


Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless.

PBUH
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2010-06-30 : 06:38:46
Bu the dates you posted in your sample data & the sample o/p are not matching.


Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless.

PBUH
Go to Top of Page
   

- Advertisement -