WHERE SELECT lname,fname, CONCAT_WS('-',SUBSTRING(dateadm,1,4)-543,SUBSTRING(dateadm,5,2),SUBSTRING(dateadm,7,2)) AS fulldate FROM m_registerdata
WHERE dateadm LIKE '2009-01-12'
อยากให้การกำหนดเงื่อนไข เป็นแบบนี้ได้หรอป่าครับ WHERE dateadm LIKE '2009-01-12'
SELECT lname,fname, CONCAT_WS('-',SUBSTRING(dateadm,1,4)-543,SUBSTRING(dateadm,5,2),SUBSTRING(dateadm,7,2)) AS dateadm FROM m_registerdata
WHERE dateadm = REPLACE('2009-01-12','-','')
SELECT dateadm,REPLACE('2009-01-12','-',''),lname,fname, CONCAT_WS('-',SUBSTRING(dateadm,1,4)-543,SUBSTRING(dateadm,5,2),SUBSTRING(dateadm,7,2)) AS dateadm FROM m_registerdata
SELECT dateadm,REPLACE(dateadm,'-',''),lname,fname, CONCAT_WS('-',SUBSTRING(dateadm,1,4)-543,SUBSTRING(dateadm,5,2),SUBSTRING(dateadm,7,2)) AS dateadm FROM m_registerdata
SELECT dateadm,REPLACE(dateadm,'-',''),lname,fname, CONCAT_WS('-',SUBSTRING(dateadm,1,4)-543,SUBSTRING(dateadm,5,2),SUBSTRING(dateadm,7,2)) AS dateadm FROM m_registerdata