Microsoft
Software
Hardware
Network
Question : MS Access SQL Divide by Zero workaround needed
I am writing some SQL (using Access 2007) that sums a column and then uses this value to calculate a percentage of another summed column. However, if there is no data for the denominator summed column, I get the #error result (divide by zero). How can I just replace this quotient with a zero instead of the #error value?
If Sum(Sales.[Total Sales]) below is 0, then I get the #error value for PayrollPercent, and the form that PayrollPercent value is displayed in does not work (not sure why it does not work and simply does not display #error, but that is a separate question)
1:
SELECT Sum(Sales.Payroll)/Sum(Sales.[Total Sales]) AS PayrollPercent FROM Sales
Answer : MS Access SQL Divide by Zero workaround needed
SELECT IIF(Sum(Sales.[Total Sales])=0,0, Sum(Sales.Payroll)/Sum(Sal
es.[Total Sales]) ) AS PayrollPercent FROM Sales
mx
Random Solutions
Help needed to choose create automated process for data feed FTP upload
urgent: how to change the nic speed from 100 half to 1000full in Solaris10
Can someone please advise the best way to migrate a drupal CMS website to another server
iphone sees wifi network but password incorrect
Include page headers when printing HTML pages with different headers on some of each page
Script needed to close program and stop/start service
Microsoft.SqlServer.Dts.Pi
peline in XML
Sonicwall TZ100 WLAN to LAN traffic
What software can I use to monitor my internet bandwidth usage?
Security Status within SBS Console showing all workstations as critical