求大神帮忙看个sql语句
把这个access 语法改成sql server的 谢谢了
SELECT PhotoID, PhotoUrl, PublishDate FROM PhotoInfo, (SELECT FORMAT(PublishDate, 'yyyy-mm-dd') AS PDate, MAX(PhotoID) AS PID FROM PhotoInfo GROUP BY FORMAT(PublishDate, 'yyyy-mm-dd')) t1 WHERE t1.PID=PhotoInfo.PhotoID AND PublishDate>=#2013-10-1 0:00:00# AND PublishDate<#2013-11-1 0:00:00#
SELECT PhotoID, PhotoUrl, PublishDate
FROM PhotoInfo,
(SELECT CONVERT(varchar(10),PublishDate,120) AS PDate, MAX(PhotoID) AS PID
FROM PhotoInfo
GROUP BY CONVERT(varchar(10),PublishDate,120)
) t1
WHERE t1.PID=PhotoInfo.PhotoID
AND CONVERT(varchar(10),PublishDate,120)>='2013-10-01'
AND CONVERT(varchar(10),PublishDate,120)<'2013-11-01'