Question: ```
    i.Notes, SUM(l.Discount) AS Dcount, i.DiscDate, i.DueDate, i.UIMth, i.UISeq, poj.Job, poj.Description, i.UniqueAttchID, i.ReviewerGroup AS RevGrp, SUM(l.GrossAmt) 
                     AS GrossAmt, v.PayTerms, dbo.HQPT.DiscRate, i.InvTotal, DATEDIFF(day,getdate(),i.DiscDate) AS DiscDays,
--Trying to use the DiscDays and Dcount here    
                    if DiscDays, between '20' and '11' THEN sum(Dcount) as YelDisc  

```

I am hoping someone can help me here. I am very new to T-SQL. I believe what I need here is a sub Query but I'm not sure how to format it correctly 

Thank you

Answer: 
Just skip all blank lines:

```
 while ((line = br.readLine()) != null) {
     if( line.trim().isEmpty() ) {
          continue;
     }
     ....
     ....

```

The last line may contain some control characters (like new line, carriage return, EOF and others unvisible chars), in this case a simple String#trim() doesn't remove them, see this answer to know how to remove them: [How can i remove all control characters from a java string?](https://stackoverflow.com/questions/9057083/how-can-i-remove-all-control-characters-from-a-java-string)
Instead of replace method use replaceAll method. Then it will work.