Link to home
Start Free TrialLog in
Avatar of Jordan Johnson
Jordan Johnson

asked on

How can I get this SQL count query to return 0 count results?

Here is the query example:

strSQL = "SELECT substring(empno, 2, LEN(empno)),
                 substring(email, 1, LEN(email)-15),
                 IsNull(COUNT(DISTINCT recid),0) as thecount
          from reldocnotes
          left outer join techstaff ON reldocnotes.enteredby = substring(email, 1, LEN(email)-15)
          where techstaff.active <> '0' AND
                substring(techstaff.empno, 2, LEN(techstaff.empno)) <> '127' AND
                thedate between '"&startDate&"' AND '"&endDate&"'
          group by substring(techstaff.empno, 2, LEN(techstaff.empno)), substring(techstaff.email, 1, (LEN(techstaff.email)-15))
          order by thecount " & sortonorder & ";"

Open in new window


Can anyone point me in the right direction? Thanks!
SOLUTION
Avatar of Brian Crowe
Brian Crowe
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial