• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 264
  • Last Modified:

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;
0
Sean Rhudy
Asked:
Sean Rhudy
1 Solution
 
Ryan ChongCommented:
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

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now