I am having trouble using the concat() function in MySQL to create a string that displays a date. The issue appears to be with passing a variable or function to the concat function.
SELECT client.client_name AS Client Name
, month(curdate()) AS exp1
, concat('2012/' , '5' , '/' , '6') AS exp2
, concat('2012' , '/' , month(curdate())) AS exp3
, concat('2012/' , client.start_day_of_month) AS exp4
FROM client
GROUP BY client.client_name
The results show as follows:
Client Name | exp1 | exp2 | exp3 | exp4
Client A | 10 | 2012/5/6 | BLOB | BLOB
I am not able to get the concat() to work with exp3 and exp4:
concat('2012' , '/' , month(curdate())) AS exp3
concat('2012/' , client.start_day_of_month) AS exp4
I think this is due to passing the function or variable to concat(), but I can't figure out how to get it to work properly. I've tried all types of syntax/quotes but can't seem to figure out the issue.