Hello,
The below SQL query from MS ACCESS works fine, but not when used in SQL
server. The error returns First is not a recognized built-in function
name. Can anyone tell me what's the equivalent of 'First' for SQL
server or is there another way of rewriting the query so it's more
standard and acceptable in both MS ACCESS and SQL server?
Thanks in advance for any suggestions or solutions.
SELECT TABLE_1.Name,
SUM(TABLE_1.Views) AS SumOfViews,
TABLE_1.InfoDate, TABLE_2.URL,
TABLE_2.Company,
TABLE_2.Stop,
TABLE_2.Type,
TABLE_2.Start,
TABLE_2.Image,
TABLE_2.Status
FROM TABLE_1 INNER JOIN
TABLE_2 ON
TABLE_1.Name = TABLE_2.Name
GROUP BY TABLE_1.Name,
TABLE_1.InfoDate, TABLE_2.URL,
TABLE_2.Company,
TABLE_2.Stop,
TABLE_2.Type,
TABLE_2.Start,
TABLE_2.Image,
TABLE_2.Status
HAVING (((TABLE_1.Name) = 'MyCompany')
AND ((TABLE_1.InfoDate)
LIKE '%December%' AND (TABLE_1.InfoDate)
LIKE '%December%'))
ORDER BY First(TABLE_1.ID)
Best Regards,
Vincent