New answers tagged server
Have you tried adding "TOP 1" to the selects? SELECT TOP 1 MAX(f3.History_date).... SELECT TOP 1 MAX(encounter_date).... TOP 1 should guarantee only one record is returned, even if you have two records with the same MAX value (which seems like your case). Also, have you tried running your SELECT statements on their own to confirm that you're only ...
Try to give full access to the database file(.mdf) and then you can attach it to your database http://www.sqlserverlogexplorer.com/how-to-attach-mdf-file-without-ldf-file/
Top 50 recent answers are included