Coordinator
Join Date: Oct 2000
Location: Big Ten Country
|
Well, here's my query in entirety now, and this will probably show what I was trying to do, but ended up doing the long way:
Quote:
with query1 as (select
Financial_Analysis.AxGage.[Policy Info Master].CO,
Financial_Analysis.AxGage.[mapping DLM, Ext Form, Int Form].Product,
[Financial_Analysis].[AxGage].[Policy Info Master].IssDate as I,
[Financial_Analysis].[AxGage].[Policy Info Master].PTDate as P,
[Financial_Analysis].[AxGage].[Policy Info Master].polannprem as polannprem,
Financial_Analysis.AxGage.[Policy Info Master].IssYr,
Financial_Analysis.AxGage.[Policy Info Master].ISST,
Financial_Analysis.AxGage.[Policy Info Master].AGENT,
Underwriting_DB.dbo.Agent_Realigned.Status
From
Financial_Analysis.AxGage.[Policy Info Master]
INNER JOIN Financial_Analysis.AxGage.[mapping DLM, Ext Form, Int Form] on
Financial_Analysis.AxGage.[Policy Info Master].[Int Form] = Financial_Analysis.AxGage.[mapping DLM, Ext Form, Int Form].[Int Form]
LEFT OUTER JOIN Underwriting_DB.dbo.Altagt ON
Financial_Analysis.AxGage.[Policy Info Master].AGENT = Underwriting_DB.dbo.Altagt.Altcd
LEFT OUTER JOIN Underwriting_DB.dbo.Agent_Realigned ON
Underwriting_DB.dbo.Altagt.Agtcd = Underwriting_DB.dbo.Agent_Realigned.Agent)
select
CO,
Product,
IssYr,
ISST,
Agent,
Status,
case
when (P < convert(datetime,'04-01-2007')) then '0'
when (I > convert(datetime,'06-30-2007')) then '0'
when ((I <= convert(datetime,'04-01-2007')) and (P >= convert(datetime,'06-30-2007'))) then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'04-01-2007'), convert(datetime,'06-30-2007')) as float)+1)/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2007'), convert(datetime,'12-31-2007')) as float)+1)
when ((I > convert(datetime,'04-01-2007')) and(P >= convert(datetime,'06-30-2007')))
then polannprem*(cast(DATEDIFF(DAY, I, convert(datetime,'06-30-2007'))+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2007'), convert(datetime,'12-31-2007')) as float)+1)
when ((I <= convert(datetime,'04-01-2007')) and (P < convert(datetime,'06-30-2007')))
then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'04-01-2007'), P)+1 as float))/(cast(DATEDIFF(day, convert(datetime,'01-01-2007'), convert(datetime,'12-31-2007')) as float)+1)
when ((I > convert(datetime,'04-01-2007')) and (P < convert(datetime,'06-30-2007')))
then polannprem*(cast(DATEDIFF(DAY, I, P)+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2007'), convert(datetime,'12-31-2007')) as float)+1)
end as EP2007Q2,
case
when (P < convert(datetime,'07-01-2007')) then '0'
when (I > convert(datetime,'09-30-2007')) then '0'
when ((I <= convert(datetime,'07-01-2007')) and (P >= convert(datetime,'09-30-2007'))) then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'07-01-2007'), convert(datetime,'09-30-2007')) as float)+1)/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2007'), convert(datetime,'12-31-2007')) as float)+1)
when ((I > convert(datetime,'07-01-2007')) and(P >= convert(datetime,'09-30-2007')))
then polannprem*(cast(DATEDIFF(DAY, I, convert(datetime,'09-30-2007'))+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2007'), convert(datetime,'12-31-2007')) as float)+1)
when ((I <= convert(datetime,'07-01-2007')) and (P < convert(datetime,'09-30-2007')))
then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'07-01-2007'), P)+1 as float))/(cast(DATEDIFF(day, convert(datetime,'01-01-2007'), convert(datetime,'12-31-2007')) as float)+1)
when ((I > convert(datetime,'07-01-2007')) and (P < convert(datetime,'09-30-2007')))
then polannprem*(cast(DATEDIFF(DAY, I, P)+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2007'), convert(datetime,'12-31-2007')) as float)+1)
end as EP2007Q3,
case
when (P < convert(datetime,'10-01-2007')) then '0'
when (I > convert(datetime,'12-31-2007')) then '0'
when ((I <= convert(datetime,'10-01-2007')) and (P >= convert(datetime,'12-31-2007'))) then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'10-01-2007'), convert(datetime,'12-31-2007')) as float)+1)/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2007'), convert(datetime,'12-31-2007')) as float)+1)
when ((I > convert(datetime,'10-01-2007')) and(P >= convert(datetime,'12-31-2007')))
then polannprem*(cast(DATEDIFF(DAY, I, convert(datetime,'12-31-2007'))+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2007'), convert(datetime,'12-31-2007')) as float)+1)
when ((I <= convert(datetime,'10-01-2007')) and (P < convert(datetime,'12-31-2007')))
then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'10-01-2007'), P)+1 as float))/(cast(DATEDIFF(day, convert(datetime,'01-01-2007'), convert(datetime,'12-31-2007')) as float)+1)
when ((I > convert(datetime,'10-01-2007')) and (P < convert(datetime,'12-31-2007')))
then polannprem*(cast(DATEDIFF(DAY, I, P)+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2007'), convert(datetime,'12-31-2007')) as float)+1)
end as EP2007Q4,
case
when (P < convert(datetime,'01-01-2008')) then '0'
when (I > convert(datetime,'03-31-2008')) then '0'
when ((I <= convert(datetime,'01-01-2008')) and (P >= convert(datetime,'03-31-2008'))) then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'01-01-2008'), convert(datetime,'03-31-2008')) as float)+1)/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2008'), convert(datetime,'12-31-2008')) as float)+1)
when ((I > convert(datetime,'01-01-2008')) and(P >= convert(datetime,'03-31-2008')))
then polannprem*(cast(DATEDIFF(DAY, I, convert(datetime,'03-31-2008'))+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2008'), convert(datetime,'12-31-2008')) as float)+1)
when ((I <= convert(datetime,'01-01-2008')) and (P < convert(datetime,'03-31-2008')))
then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'01-01-2008'), P)+1 as float))/(cast(DATEDIFF(day, convert(datetime,'01-01-2008'), convert(datetime,'12-31-2008')) as float)+1)
when ((I > convert(datetime,'01-01-2008')) and (P < convert(datetime,'03-31-2008')))
then polannprem*(cast(DATEDIFF(DAY, I, P)+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2008'), convert(datetime,'12-31-2008')) as float)+1)
end as EP2008Q1,
case
when (P < convert(datetime,'04-01-2008')) then '0'
when (I > convert(datetime,'06-30-2008')) then '0'
when ((I <= convert(datetime,'04-01-2008')) and (P >= convert(datetime,'06-30-2008'))) then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'04-01-2008'), convert(datetime,'06-30-2008')) as float)+1)/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2008'), convert(datetime,'12-31-2008')) as float)+1)
when ((I > convert(datetime,'04-01-2008')) and(P >= convert(datetime,'06-30-2008')))
then polannprem*(cast(DATEDIFF(DAY, I, convert(datetime,'06-30-2008'))+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2008'), convert(datetime,'12-31-2008')) as float)+1)
when ((I <= convert(datetime,'04-01-2008')) and (P < convert(datetime,'06-30-2008')))
then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'04-01-2008'), P)+1 as float))/(cast(DATEDIFF(day, convert(datetime,'01-01-2008'), convert(datetime,'12-31-2008')) as float)+1)
when ((I > convert(datetime,'04-01-2008')) and (P < convert(datetime,'06-30-2008')))
then polannprem*(cast(DATEDIFF(DAY, I, P)+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2008'), convert(datetime,'12-31-2008')) as float)+1)
end as EP2008Q2,
case
when (P < convert(datetime,'07-01-2008')) then '0'
when (I > convert(datetime,'09-30-2008')) then '0'
when ((I <= convert(datetime,'07-01-2008')) and (P >= convert(datetime,'09-30-2008'))) then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'07-01-2008'), convert(datetime,'09-30-2008')) as float)+1)/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2008'), convert(datetime,'12-31-2008')) as float)+1)
when ((I > convert(datetime,'07-01-2008')) and(P >= convert(datetime,'09-30-2008')))
then polannprem*(cast(DATEDIFF(DAY, I, convert(datetime,'09-30-2008'))+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2008'), convert(datetime,'12-31-2008')) as float)+1)
when ((I <= convert(datetime,'07-01-2008')) and (P < convert(datetime,'09-30-2008')))
then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'07-01-2008'), P)+1 as float))/(cast(DATEDIFF(day, convert(datetime,'01-01-2008'), convert(datetime,'12-31-2008')) as float)+1)
when ((I > convert(datetime,'07-01-2008')) and (P < convert(datetime,'09-30-2008')))
then polannprem*(cast(DATEDIFF(DAY, I, P)+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2008'), convert(datetime,'12-31-2008')) as float)+1)
end as EP2008Q3,
case
when (P < convert(datetime,'10-01-2008')) then '0'
when (I > convert(datetime,'12-31-2008')) then '0'
when ((I <= convert(datetime,'10-01-2008')) and (P >= convert(datetime,'12-31-2008'))) then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'10-01-2008'), convert(datetime,'12-31-2008')) as float)+1)/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2008'), convert(datetime,'12-31-2008')) as float)+1)
when ((I > convert(datetime,'10-01-2008')) and(P >= convert(datetime,'12-31-2008')))
then polannprem*(cast(DATEDIFF(DAY, I, convert(datetime,'12-31-2008'))+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2008'), convert(datetime,'12-31-2008')) as float)+1)
when ((I <= convert(datetime,'10-01-2008')) and (P < convert(datetime,'12-31-2008')))
then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'10-01-2008'), P)+1 as float))/(cast(DATEDIFF(day, convert(datetime,'01-01-2008'), convert(datetime,'12-31-2008')) as float)+1)
when ((I > convert(datetime,'10-01-2008')) and (P < convert(datetime,'12-31-2008')))
then polannprem*(cast(DATEDIFF(DAY, I, P)+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2008'), convert(datetime,'12-31-2008')) as float)+1)
end as EP2008Q4,
case
when (P < convert(datetime,'01-01-2009')) then '0'
when (I > convert(datetime,'03-31-2009')) then '0'
when ((I <= convert(datetime,'01-01-2009')) and (P >= convert(datetime,'03-31-2009'))) then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'01-01-2009'), convert(datetime,'03-31-2009')) as float)+1)/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2009'), convert(datetime,'12-31-2009')) as float)+1)
when ((I > convert(datetime,'01-01-2009')) and(P >= convert(datetime,'03-31-2009')))
then polannprem*(cast(DATEDIFF(DAY, I, convert(datetime,'03-31-2009'))+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2009'), convert(datetime,'12-31-2009')) as float)+1)
when ((I <= convert(datetime,'01-01-2009')) and (P < convert(datetime,'03-31-2009')))
then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'01-01-2009'), P)+1 as float))/(cast(DATEDIFF(day, convert(datetime,'01-01-2009'), convert(datetime,'12-31-2009')) as float)+1)
when ((I > convert(datetime,'01-01-2009')) and (P < convert(datetime,'03-31-2009')))
then polannprem*(cast(DATEDIFF(DAY, I, P)+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2009'), convert(datetime,'12-31-2009')) as float)+1)
end as EP2009Q1,
case
when (P < convert(datetime,'04-01-2009')) then '0'
when (I > convert(datetime,'06-30-2009')) then '0'
when ((I <= convert(datetime,'04-01-2009')) and (P >= convert(datetime,'06-30-2009'))) then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'04-01-2009'), convert(datetime,'06-30-2009')) as float)+1)/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2009'), convert(datetime,'12-31-2009')) as float)+1)
when ((I > convert(datetime,'04-01-2009')) and(P >= convert(datetime,'06-30-2009')))
then polannprem*(cast(DATEDIFF(DAY, I, convert(datetime,'06-30-2009'))+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2009'), convert(datetime,'12-31-2009')) as float)+1)
when ((I <= convert(datetime,'04-01-2009')) and (P < convert(datetime,'06-30-2009')))
then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'04-01-2009'), P)+1 as float))/(cast(DATEDIFF(day, convert(datetime,'01-01-2009'), convert(datetime,'12-31-2009')) as float)+1)
when ((I > convert(datetime,'04-01-2009')) and (P < convert(datetime,'06-30-2009')))
then polannprem*(cast(DATEDIFF(DAY, I, P)+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2009'), convert(datetime,'12-31-2009')) as float)+1)
end as EP2009Q2,
case
when (P < convert(datetime,'07-01-2009')) then '0'
when (I > convert(datetime,'09-30-2009')) then '0'
when ((I <= convert(datetime,'07-01-2009')) and (P >= convert(datetime,'09-30-2009'))) then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'07-01-2009'), convert(datetime,'09-30-2009')) as float)+1)/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2009'), convert(datetime,'12-31-2009')) as float)+1)
when ((I > convert(datetime,'07-01-2009')) and(P >= convert(datetime,'09-30-2009')))
then polannprem*(cast(DATEDIFF(DAY, I, convert(datetime,'09-30-2009'))+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2009'), convert(datetime,'12-31-2009')) as float)+1)
when ((I <= convert(datetime,'07-01-2009')) and (P < convert(datetime,'09-30-2009')))
then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'07-01-2009'), P)+1 as float))/(cast(DATEDIFF(day, convert(datetime,'01-01-2009'), convert(datetime,'12-31-2009')) as float)+1)
when ((I > convert(datetime,'07-01-2009')) and (P < convert(datetime,'09-30-2009')))
then polannprem*(cast(DATEDIFF(DAY, I, P)+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2009'), convert(datetime,'12-31-2009')) as float)+1)
end as EP2009Q3,
case
when (P < convert(datetime,'10-01-2009')) then '0'
when (I > convert(datetime,'12-31-2009')) then '0'
when ((I <= convert(datetime,'10-01-2009')) and (P >= convert(datetime,'12-31-2009'))) then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'10-01-2009'), convert(datetime,'12-31-2009')) as float)+1)/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2009'), convert(datetime,'12-31-2009')) as float)+1)
when ((I > convert(datetime,'10-01-2009')) and(P >= convert(datetime,'12-31-2009')))
then polannprem*(cast(DATEDIFF(DAY, I, convert(datetime,'12-31-2009'))+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2009'), convert(datetime,'12-31-2009')) as float)+1)
when ((I <= convert(datetime,'10-01-2009')) and (P < convert(datetime,'12-31-2009')))
then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'10-01-2009'), P)+1 as float))/(cast(DATEDIFF(day, convert(datetime,'01-01-2009'), convert(datetime,'12-31-2009')) as float)+1)
when ((I > convert(datetime,'10-01-2009')) and (P < convert(datetime,'12-31-2009')))
then polannprem*(cast(DATEDIFF(DAY, I, P)+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2009'), convert(datetime,'12-31-2009')) as float)+1)
end as EP2009Q4,
case
when (P < convert(datetime,'01-01-2010')) then '0'
when (I > convert(datetime,'03-31-2010')) then '0'
when ((I <= convert(datetime,'01-01-2010')) and (P >= convert(datetime,'03-31-2010'))) then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'01-01-2010'), convert(datetime,'03-31-2010')) as float)+1)/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2010'), convert(datetime,'12-31-2010')) as float)+1)
when ((I > convert(datetime,'01-01-2010')) and(P >= convert(datetime,'03-31-2010')))
then polannprem*(cast(DATEDIFF(DAY, I, convert(datetime,'03-31-2010'))+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2010'), convert(datetime,'12-31-2010')) as float)+1)
when ((I <= convert(datetime,'01-01-2010')) and (P < convert(datetime,'03-31-2010')))
then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'01-01-2010'), P)+1 as float))/(cast(DATEDIFF(day, convert(datetime,'01-01-2010'), convert(datetime,'12-31-2010')) as float)+1)
when ((I > convert(datetime,'01-01-2010')) and (P < convert(datetime,'03-31-2010')))
then polannprem*(cast(DATEDIFF(DAY, I, P)+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2010'), convert(datetime,'12-31-2010')) as float)+1)
end as EP2010Q1,
case
when (P < convert(datetime,'04-01-2010')) then '0'
when (I > convert(datetime,'06-30-2010')) then '0'
when ((I <= convert(datetime,'04-01-2010')) and (P >= convert(datetime,'06-30-2010'))) then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'04-01-2010'), convert(datetime,'06-30-2010')) as float)+1)/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2010'), convert(datetime,'12-31-2010')) as float)+1)
when ((I > convert(datetime,'04-01-2010')) and(P >= convert(datetime,'06-30-2010')))
then polannprem*(cast(DATEDIFF(DAY, I, convert(datetime,'06-30-2010'))+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2010'), convert(datetime,'12-31-2010')) as float)+1)
when ((I <= convert(datetime,'04-01-2010')) and (P < convert(datetime,'06-30-2010')))
then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'04-01-2010'), P)+1 as float))/(cast(DATEDIFF(day, convert(datetime,'01-01-2010'), convert(datetime,'12-31-2010')) as float)+1)
when ((I > convert(datetime,'04-01-2010')) and (P < convert(datetime,'06-30-2010')))
then polannprem*(cast(DATEDIFF(DAY, I, P)+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2010'), convert(datetime,'12-31-2010')) as float)+1)
end as EP2010Q2,
case
when (P < convert(datetime,'07-01-2010')) then '0'
when (I > convert(datetime,'09-30-2010')) then '0'
when ((I <= convert(datetime,'07-01-2010')) and (P >= convert(datetime,'09-30-2010'))) then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'07-01-2010'), convert(datetime,'09-30-2010')) as float)+1)/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2010'), convert(datetime,'12-31-2010')) as float)+1)
when ((I > convert(datetime,'07-01-2010')) and(P >= convert(datetime,'09-30-2010')))
then polannprem*(cast(DATEDIFF(DAY, I, convert(datetime,'09-30-2010'))+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2010'), convert(datetime,'12-31-2010')) as float)+1)
when ((I <= convert(datetime,'07-01-2010')) and (P < convert(datetime,'09-30-2010')))
then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'07-01-2010'), P)+1 as float))/(cast(DATEDIFF(day, convert(datetime,'01-01-2010'), convert(datetime,'12-31-2010')) as float)+1)
when ((I > convert(datetime,'07-01-2010')) and (P < convert(datetime,'09-30-2010')))
then polannprem*(cast(DATEDIFF(DAY, I, P)+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2010'), convert(datetime,'12-31-2010')) as float)+1)
end as EP2010Q3,
case
when (P < convert(datetime,'10-01-2010')) then '0'
when (I > convert(datetime,'12-31-2010')) then '0'
when ((I <= convert(datetime,'10-01-2010')) and (P >= convert(datetime,'12-31-2010'))) then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'10-01-2010'), convert(datetime,'12-31-2010')) as float)+1)/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2010'), convert(datetime,'12-31-2010')) as float)+1)
when ((I > convert(datetime,'10-01-2010')) and(P >= convert(datetime,'12-31-2010')))
then polannprem*(cast(DATEDIFF(DAY, I, convert(datetime,'12-31-2010'))+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2010'), convert(datetime,'12-31-2010')) as float)+1)
when ((I <= convert(datetime,'10-01-2010')) and (P < convert(datetime,'12-31-2010')))
then polannprem*(cast(DATEDIFF(DAY, convert(datetime,'10-01-2010'), P)+1 as float))/(cast(DATEDIFF(day, convert(datetime,'01-01-2010'), convert(datetime,'12-31-2010')) as float)+1)
when ((I > convert(datetime,'10-01-2010')) and (P < convert(datetime,'12-31-2010')))
then polannprem*(cast(DATEDIFF(DAY, I, P)+1 as float))/(cast(DATEDIFF(DAY, convert(datetime,'01-01-2010'), convert(datetime,'12-31-2010')) as float)+1)
end as EP2010Q4
From query1
GROUP BY
CO,
Product,
IssYr,
ISST,
Agent,
Status
|
|