-
-
Save api-padawan/5421852 to your computer and use it in GitHub Desktop.
GL_Detail_Custom Data source for Document Designer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO [CIS].[dbo].[DocumentQuery] ([Name] ,[SQL] ,[ActiveFlag]) | |
VALUES | |
('GL_Detail_Custom' | |
,'SELECT GL.[Code] | |
,GL.[CodeDescription] | |
,GL.[DateAdded] | |
,GL.[DateDropped] | |
,GL.[Sales] as [Exposure] | |
,GL.[FlagDropped] | |
,GL.[FlagRackleyRated] | |
,GL.[Pr334] as [PremisesPremium] | |
,CASE GL.[PremiumBase] | |
WHEN ''e'' THEN ''Each'' | |
WHEN ''a'' THEN ''Area'' | |
WHEN ''p'' THEN ''Payroll'' | |
WHEN ''u'' THEN ''Units'' | |
WHEN ''s'' THEN ''Sales'' | |
WHEN ''t'' THEN ''Total Cost'' | |
ELSE GL.[PremiumBase] END as [PremiumBase] | |
,GL.[FinalMod334] as [PremisesRate] | |
,GL.[Pr336] as [ProductPremium] | |
,GL.[FinalMod336] as [ProductRate] | |
,GL.[RatePer] | |
,GL.[Premium] as [TotalPremium] | |
,RC.Description AS [RatingBasis] | |
,L.Description AS [LocDesc] | |
,L.Address | |
,L.City | |
,L.State | |
,L.Zip | |
FROM [CIS].[dbo].[taaGLRatingDetail] GL | |
INNER JOIN [CIS].[dbo].[Quote] QU (NOLOCK) ON GL.ReferenceKey_FK = QU.ReferenceID | |
INNER JOIN CIS.dbo.taaLocations L (NOLOCK) ON GL.LocationKey_FK=L.LocationKey_PK | |
LEFT OUTER JOIN CIS.dbo.taaRatingCodes RC ON GL.PremiumBase=RC.IDCode | |
WHERE QU.QuoteID = :Quote#QuoteID' | |
,'Y') | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment