I have an Acccss Database which contains details about photos which belong to different albums. I'm trying to select the information about the album and grab the first photo that belongs to that album to use as a cover photo. If no photo has been added to the album I use a default image.
This is the code I have so far, where am I going wrong?
IIF( Pho.FilePath IS NULL,
Pho.FilePath ) AS FilePath
FROM Albums as Alb
LEFT OUTER JOIN Photos as Pho
ON (Pho.AlbumID = Alb.AlbumID
AND Pho.PhotoID =
(SELECT MIN(PhotoID) FROM Photos WHERE AlbumID = Alb.AlbumID )