Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 3 of 3 total |
Why not?? |
Fri, Oct 12 2018 2:04 AM | Permanent Link |
Ian Branch |
Attachments: Screenshot_4.jpg |
Fri, Oct 12 2018 3:33 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Ian
I'm having a look at it, I suspect that you'll need sub selects. Roy Lambert |
Fri, Oct 12 2018 3:43 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Ian
I hope I understood what you were trying to do correctly. You'll have to replace my column / table names with your own select _fkProjects AS "Job Type" , count(_LastResult) as "Tota lUnits", count(distinct _LastResult) as "Unique Units", (SELECT count(_LastResult) FROM Calls X WHERE X._LastResult = Calls._LastResult AND X._fkProjects = Calls._fkProjects GROUP BY _LastResult RANGE 1 TO 1) - (SELECT count(DISTINCT _LastResult) FROM Calls X WHERE X._LastResult = Calls._LastResult AND X._fkProjects = Calls._fkProjects GROUP BY _LastResult RANGE 1 TO 1) AS "Repeats" from Calls where (trim(BOTH ' ' from _LastResult) <> '') group by _fkProjects, _LastResult; The fundamental problem was that the GROUP BY wasn't extended far enough to isolate the counts you wanted and the results you got sort of looked right but weren't Roy Lambert |
This web page was last updated on Tuesday, September 17, 2024 at 04:19 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |