Created
January 16, 2018 02:21
-
-
Save ctrl-freak/88e50bf65f5b7009aa4493c5c57f72ee to your computer and use it in GitHub Desktop.
Procura HACC MDS Statistical Linkage Key SQL SELECT
This file contains hidden or 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
-- Government of Western Australia | |
-- Department of Health | |
-- HACC – Minimum Data Set | |
-- http://ww2.health.wa.gov.au/Articles/F_I/HACC-minimum-data-set | |
-- http://ww2.health.wa.gov.au/~/media/Files/Corporate/general%20documents/HACC/PDF/WA_MDS_User_Guide2014.pdf | |
SELECT | |
UPPER(CONCAT( | |
SUBSTRING( | |
LEFT(CONCAT( | |
REPLACE( | |
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE( | |
CLIENTS.LASTNAME | |
, ' ', ''), '''', ''),'(',''),')',''),'-','') | |
,' ','2') | |
,'22222'),5) | |
,2,2), | |
SUBSTRING( | |
LEFT(CONCAT( | |
REPLACE( | |
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE( | |
CLIENTS.LASTNAME | |
, ' ', ''), '''', ''),'(',''),')',''),'-','') | |
,' ','2') | |
,'22222'),5) | |
,5,1), | |
SUBSTRING( | |
LEFT(CONCAT( | |
REPLACE( | |
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE( | |
CLIENTS.FIRSTNAME | |
, ' ', ''), '''', ''),'(',''),')',''),'-','') | |
,' ','2') | |
,'22222'),5) | |
,2,2) | |
)) AS LettersOfName | |
FROM CLIENTS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment