I am having problems with the MYSQL Command Line client on my computer and was wondering if you think these queries will work. Assuming that correct tables and data have been inputted.
This should select the average length of time someone stays at a hotel at any one time:
SELECT [Hotel Name], AVG(DATEDIFF ( "y" , FORMAT ( [Date of Arrival], "DD/MM/YYYY") , FORMAT ( [Date of departure], "DD/MM/YYYY") )) AS [Average Days]
GROUP BY [Hotel Name]
Thanks. I'm unsure if the Square brackets are required?