Created
June 25, 2020 11:47
-
-
Save jonwitts/ade50f0975a9384860b52a983aebbca6 to your computer and use it in GitHub Desktop.
SQL Query to extract the newest student photo file from the iSAMS database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- SQL Script to get the latest student photos out of iSAMS | |
SELECT txtEmailAddress, | |
(SELECT TOP (1) txtPath FROM TblPupilManagementPictures | |
WHERE (txtSchoolID = TblPupilManagementPupils.txtSchoolID) | |
ORDER BY intOrder DESC) AS txtPupilPicturePath | |
FROM TblPupilManagementPupils | |
WHERE (intSystemStatus = '1') AND | |
((SELECT TOP (1) txtPath | |
FROM TblPupilManagementPictures AS TblPupilManagementPictures_1 | |
WHERE (txtSchoolID = TblPupilManagementPupils.txtSchoolID) | |
ORDER BY intOrder DESC) | |
IS NOT NULL) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment