Query #10

Colby Jensen asked 2 years ago

When I run my query I don\\\’t get results back.  I can\\\’t seem to pinpoint where my error is.  Any ideas?  Would it be in my links?  Maybe what I am counting?  It doesn\\\’t give me an error, it just isn\\\’t giving me any results.   SELECT creditdescription, COUNT(encid) AS encounter_count FROM creditrating INNER JOIN customer ON creditrating.creditid = customer.creditid INNER JOIN encounter ON customer.customerid = encounter.customerid INNER JOIN salesperson ON encounter.salesid = salesperson.salesid WHERE encdate IN (\\\’2015-07-05\\\’,\\\’2015-07-12\\\’,\\\’2015-07-19\\\’,\\\’2015-07-26\\\’) GROUP BY creditdescription ORDER BY creditdescription DESC

Colby Jensen replied 2 years ago

Sorry, the text turned out weird. Here is my question better formatted.

When I run my query I don’t get results back. I can’t seem to pinpoint where my error is. Any ideas? Would it be in my links? Maybe what I am counting? It doesn’t give me an error, it just isn’t giving me any results.

SELECT creditdescription, COUNT(encid) AS encounter_count
FROM creditrating
INNER JOIN customer ON creditrating.creditid = customer.creditid
INNER JOIN encounter ON customer.customerid = encounter.customerid INNER JOIN salesperson ON encounter.salesid = salesperson.salesid WHERE encdate IN (’2015-07-05’,’2015-07-12’,’2015-07-19’,’2015-07-26’) GROUP BY creditdescription ORDER BY creditdescription DESC

Colby Jensen replied 2 years ago

Sorry, the text turned out weird. Here is my question better formatted.

When I run my query I don’t get results back. I can’t seem to pinpoint where my error is. Any ideas? Would it be in my links? Maybe what I am counting? It doesn’t give me an error, it just isn’t giving me any results.

SELECT creditdescription, COUNT(encid) AS encounter_count
FROM creditrating
INNER JOIN customer ON creditrating.creditid = customer.creditid
INNER JOIN encounter ON customer.customerid = encounter.customerid INNER JOIN salesperson ON encounter.salesid = salesperson.salesid WHERE encdate IN (’2015-07-05’,’2015-07-12’,’2015-07-19’,’2015-07-26’) GROUP BY creditdescription ORDER BY creditdescription DESC

1 Answers
Justis answered 2 years ago

Use ORs instead of the IN, for some reason date data types don’t work with IN

Your Answer

11 + 1 =

css.php