![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 5 of 5 total |
![]() |
Sun, May 13 2018 4:52 AM | Permanent Link |
Mike | Hi,
I am using the following SQL statement as sub select. SELECT COUNT(OrderID) AS MyCount FROM Jobs WHERE OrderID= ![]() How can I set the return value from count(orderid) to 0 when it is null? |
Sun, May 13 2018 5:37 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Mike
Is the problem that you get some rows with a null or (as I'm guessing) that you get no rows? Roy |
Sun, May 13 2018 5:43 AM | Permanent Link |
Mike | Hi Roy,
I get some rows with a null. The null value must be set to 0. |
Sun, May 13 2018 5:48 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Mike
Just looking at it again I think your problem will be solved if you just drop the GROUP BY clause. I'd also use COUNT(*) SELECT COUNT(*) AS MyCount FROM Jobs WHERE OrderID= ![]() You are picking a single OrderID so the GROUP BY is essentially grouping everything there anyway and isn't needed Roy Lambert |
Sun, May 13 2018 5:57 AM | Permanent Link |
Mike | Thank you!
That seems to do the trick. |
This web page was last updated on Wednesday, July 2, 2025 at 06:46 PM | Privacy Policy![]() © 2025 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |