LloydDobler
Technical User
Could use a little help on a select statement. Is there anyway I can do a CASE statement to return results that will show a percentage of on time receipts? I'm doing a count of the 'expiredate' for that time frame, and doing a sum of the 'ontime' value, but I want a percent as my final number. I'm currently doing this using CASE statements in 3 separate views (one for total expiring, another for on time, then a 3rd to get my %), but would like it all in one if possible.
TABLE
division expiredate receivedate ontime
1 02/04/06 02/03/06 1
1 01/31/06 02/02/06 0
1 01/20/06 01/15/06 1
2 01/20/06 01/13/06 1
2 01/31/06 01/12/06 1
2 02/14/06 02/24/06 0
DESIRED RESULTS
division year JAN FEB...
1 2006 50 100
2 2006 100 0
"I don't want to sell anything, buy anything or process anything as a career. I don't want to sell anything bought or processed... or buy anything sold or processed... or process anything sold, bought or processed... or repair anything sold, bought or processed. You know, as a career, I don't want to do that."
TABLE
division expiredate receivedate ontime
1 02/04/06 02/03/06 1
1 01/31/06 02/02/06 0
1 01/20/06 01/15/06 1
2 01/20/06 01/13/06 1
2 01/31/06 01/12/06 1
2 02/14/06 02/24/06 0
DESIRED RESULTS
division year JAN FEB...
1 2006 50 100
2 2006 100 0
"I don't want to sell anything, buy anything or process anything as a career. I don't want to sell anything bought or processed... or buy anything sold or processed... or process anything sold, bought or processed... or repair anything sold, bought or processed. You know, as a career, I don't want to do that."