Need help with select case in Access 2007 query

Hello, how can I subtract 23 from sum(tblCountData.Incount) only if the value is greater than 0? Using Access 2007

SELECT tblCountData.RecDate, sum(tblCountData.Incount) AS trafficcount
FROM tblCountData
GROUP BY tblCountData.RecDate;
Sean RhudyPresidentAsked:
Who is Participating?
 
Ryan ChongConnect With a Mentor Commented:
try:

SELECT tblCountData.RecDate, IIF(sum(tblCountData.Incount) > 0, sum(tblCountData.Incount)-23, sum(tblCountData.Incount)) AS trafficcount
FROM tblCountData
GROUP BY tblCountData.RecDate;
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.