5 pts.
 Return zero when there’s no data
I am trying to write a query that I can use to generate an Excel chart to show activity in our database. I have it returning rows for each minute over the previous two hours (no problem). The problem comes when I plot a line chart. If there's no activity in a given minute, there's no row returned, which causes a break in the series on the chart. How can I write the query to return zero for minutes where there is no activity?

Software/Hardware used:
ASKED: May 20, 2008  2:02 AM
UPDATED: May 20, 2008  12:24 PM

Answer Wiki:
Hello DenM, you can use the SQL function <i>IsNull</i>, that's to say: <pre> SELECT ISNULL(MYFIELD,0) AS MYVALUE FROM MY TABLE</pre> Bye
Last Wiki Answer Submitted:  May 20, 2008  5:37 am  by  alessandro.panzetta   9,660 pts.
All Answer Wiki Contributors:  alessandro.panzetta   9,660 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _