This topic is locked
[SOLVED]

 MYSQL dayname

6/14/2012 3:39:14 AM
PHPRunner General questions
P
prattster1874 author

Hi,
I have used the dayname function in my MYSQL query, and when I go to results within phprunner the query displays ok. However when I build the project, the day names don't appear in the list page? Anyone have any ideas?
Query:
SELECT

ID ,IFNULL(branch,6) AS branch, calendar.datefield AS DATE, IFNULL(SUM(service_import.hrs_wrked),0) AS total_hours, monthname(calendar.datefield) AS Month, dayname(calendar.datefield) AS 'DOW'

FROM service_import

RIGHT JOIN calendar ON (DATE(service_import.last_worked) = calendar.datefield)

WHERE (calendar.datefield BETWEEN (SELECT MIN(DATE(last_worked)) FROM service_import) AND (SELECT MAX(DATE(last_worked)) FROM service_import)) AND branch=6

GROUP BY DATE
On the list page the DOW field is blank, but the monthname appears as it should.

Sergey Kornilov admin 6/14/2012

Try to remove quotes around 'DOW'

P
prattster1874 author 6/20/2012



Try to remove quotes around 'DOW'


Thanks Sergey - worked perfectly. Not sure why though!! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=66697&image=1&table=forumreplies' class='bbc_emoticon' alt='B)' />