willow1985
Well-known Member
- Joined
- Jul 24, 2019
- Messages
- 915
- Office Version
- 365
- Platform
- Windows
I hope I have the right forum for this question...
I am very new to SQL and have this command text where this line is bringing in the year of shipped data. However Excel does not recognize the data.
I can fix this by doing a text to column and selecting General but I do not want to do this every time I open the sheet.
Is there anyway to format what is coming through as "General" recognized by Excel?
The line giving me issue is: FROM_UNIXTIME(t2.date_shipped, '%Y') AS Shipped Year,
The entire code is:
Thank you to anyone who can help!
I am very new to SQL and have this command text where this line is bringing in the year of shipped data. However Excel does not recognize the data.
I can fix this by doing a text to column and selecting General but I do not want to do this every time I open the sheet.
Is there anyway to format what is coming through as "General" recognized by Excel?
The line giving me issue is: FROM_UNIXTIME(t2.date_shipped, '%Y') AS Shipped Year,
The entire code is:
SQL:
SELECT
FROM_UNIXTIME(t2.date_shipped, '%b') AS `Shipped Month`,
FROM_UNIXTIME(t2.date_shipped, '%Y') AS `Shipped Year`,
COUNT(*) AS "Count of Work Orders Shipped"
FROM
erp_workorder AS t1
LEFT JOIN
erp_shipping AS t2
ON
t1.id_primary = t2.id_workorder
WHERE
t2.date_shipped <> 0
AND
t2.date_shipped > UNIX_TIMESTAMP() - ((107000 * 30) * 30)
GROUP BY IFNULL(FROM_UNIXTIME(t2.date_shipped, '%m'), 0), IFNULL(FROM_UNIXTIME(t2.date_shipped, '%Y'), 0)
ORDER BY IFNULL(FROM_UNIXTIME(t2.date_shipped, '%Y'), 0), IFNULL(FROM_UNIXTIME(t2.date_shipped, '%m'), 0)
Thank you to anyone who can help!