Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

little help

Status
Not open for further replies.

leburg

Programmer
Feb 15, 2006
64
0
0
US
I have a select statement:

SELECT number, SUM(paid1) AS dar_total
FROM dbo.payhistory
WHERE (batchtype = 'DAR')
GROUP BY number

What my new spec requires that I excluded any paid1 < .02 prior to including it in the 'sum' of them all.

All help greatly appreciated and many thanks in advance!
 
Code:
SELECT number, SUM(paid1) AS dar_total
FROM   dbo.payhistory
WHERE  batchtype = 'DAR'
       And Paid1 >= 0.02
GROUP BY number

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
george, for crying out loud, where are your parentheses, man!!

;-)

[small]and how come all your keywords are in caps except for "And"[/small]

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top