troubleshooting Question

SQL, Null value is eliminated by an aggregate or other SET operation.

Avatar of tanj1035
tanj1035 asked on
Microsoft SQL Server
6 Comments1 Solution165 ViewsLast Modified:
Hi Experts,

The error message below showed up after I ran the query . I have checked the sub-query and there was no null value in there. I do not know if the warning message will affect the result or not?  Thank you.

Warning: Null value is eliminated by an aggregate or other SET operation.

(2 row(s) affected)

SELECT  companyname 
      , SUM(CASE WHEN LoanAmountFinanced <='2500.00' THEN 1 ELSE 0 END) AS NUMBEROFLOANSLESS2500
      , SUM(CASE WHEN LoanAmountFinanced <='6000.00' AND LoanAmountFinanced >'2500.00'THEN 1 ELSE 0 END) AS NUMBEROFLOANS2500TO6000
      , SUM(CASE WHEN LoanAmountFinanced <='10000.00' AND LoanAmountFinanced >'6000.00'THEN 1 ELSE 0 END) AS NUMBEROFLOANS6000TO10000
      , SUM(CASE WHEN LoanAmountFinanced <='20000.00' AND LoanAmountFinanced >'10000.00'THEN 1 ELSE 0 END) AS NUMBEROFLOANS10000TO20000
      , SUM(CASE WHEN LoanAmountFinanced >='20000.00' THEN 1 ELSE 0 END) AS NUMBEROFLOANSOVER20000
      , SUM(CASE WHEN LoanAmountFinanced <='2500.00' THEN LoanAmountFinanced ELSE 0 END) AS LOANSLESS2500
      , SUM(CASE WHEN LoanAmountFinanced <='6000.00' AND LoanAmountFinanced >'2500.00'THEN LoanAmountFinanced ELSE 0 END) AS LOANS2500TO6000
      , SUM(CASE WHEN LoanAmountFinanced <='10000.00' AND LoanAmountFinanced >'6000.00'THEN LoanAmountFinanced ELSE 0 END) AS LOANS6000TO10000
      , SUM(CASE WHEN LoanAmountFinanced <='20000.00' AND LoanAmountFinanced >'10000.00'THEN LoanAmountFinanced ELSE 0 END) AS LOANS10000TO20000
      , SUM(CASE WHEN LoanAmountFinanced >='20000.00' THEN LoanAmountFinanced ELSE 0 END) AS LOANSOVER20000
      , MAX(CASE WHEN LoanAmountFinanced <='2500.00' THEN TILAAPR END ) AS HIGHAPRFOR0TO2500
      , MIN(CASE WHEN LoanAmountFinanced <='2500.00' THEN TILAAPR END ) AS LOWAPRFOR0TO2500
      , MAX(CASE WHEN LoanAmountFinanced >'2500.00' THEN TILAAPR END ) AS HIGHAPRFOROVER2500
      , MIN(CASE WHEN LoanAmountFinanced >'2500.00' THEN TILAAPR END ) AS LOWAPRFOROVER2500
INTO #LOANSETA
FROM (
		SELECT S.companyname  
			  , L.LoanID 
			  , L.LoanAmountFinanced
			  , FN.TILAAPR
		FROM tblLoans L inner join 
			 #GROUPBYSTORES S ON S.STOREID= L.LoanStoreID
			 CROSS APPLY GetTILAInfo (LoanID) as FN
		WHERE L.LoanDate >= '20150101' and L.LoanDate < '20160101'   
		 
      ) A
GROUP BY  companyname

Open in new window

ASKER CERTIFIED SOLUTION
Chris Luttrell
Senior Database Architect

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 6 Comments.
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>

Mike

Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 6 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004