Skip to content

Commit

Permalink
Merge pull request #152 from icefoganalytics/test
Browse files Browse the repository at this point in the history
📪 Clear mailing
  • Loading branch information
datajohnson authored Sep 18, 2023
2 parents b565c31 + 13cf9c9 commit e44f964
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions db/4_functions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3920,7 +3920,7 @@ AS
BEGIN
DECLARE cur_cslft CURSOR FOR

SELECT
SELECT DISTINCT
s.id,
app.id,
COALESCE(SUBSTRING(p.sin,1,9), ' ') AS sin
Expand Down Expand Up @@ -3955,18 +3955,15 @@ BEGIN
END),' ') AS student_postal_code
, ISNULL(sfa.fn_get_country_fct(pa.country_id),' ') AS home_country
, ISNULL(p.email,' ') as student_email
, ISNULL(pam.address1,' ') as mailing_address1
, ISNULL(pam.address2,' ') as mailing_address2
, ISNULL(sfa.fn_get_city_fct(pam.city_id),' ') mailing_city
, COALESCE(pam.province_id, ' ')
, ISNULL(sfa.fn_get_province_fct(pam.province_id),' ') AS mailing_province
, ISNULL(app.school_telephone, ' ')
, ISNULL(UPPER(CASE
WHEN LEN(pam.postal_code) = 7 THEN SUBSTRING(pam.postal_code, 1, 3) + SUBSTRING(pam.postal_code, 5, 3)
ELSE pam.postal_code
END), ' ') AS mailing_postal_code
, ISNULL(sfa.fn_get_country_fct(pam.country_id),' ') AS mailing_country
, ISNULL(app.school_email,' ') as school_email
, '' as mailing_address1
, '' as mailing_address2
, '' mailing_city
, ''
, '' AS mailing_province
, ISNULL(p.telephone, ' ')
, '' AS mailing_postal_code
, '' AS mailing_country
, ISNULL(p.email,' ') as school_email
, COALESCE(SUBSTRING(sfa.fn_get_institution_code_fct(app.institution_campus_id),1,4), ' ') AS institution_code
, COALESCE(SUBSTRING(CONVERT(VARCHAR, sfa.fn_get_field_program_code_fct(sfa.fn_get_study_field_id_fct(app.study_area_id),app.program_id)),1,2), ' ') AS field_of_study
, RIGHT('0' + CAST(SUBSTRING(ISNULL(CONVERT(VARCHAR, app.program_year), 0), 1, 1) AS VARCHAR), 1) AS program_year
Expand Down Expand Up @@ -4034,11 +4031,7 @@ BEGIN
AND d.issue_date >= @FROM_DATE_P AND d.issue_date <= @TO_DATE_P
AND (m.msfaa_status = 'Received' AND m.is_full_time = CASE WHEN d.disbursement_type_id = 4 THEN 1 ELSE 0 END OR app.academic_year_id <= 2012)
AND d.ecert_sent_date IS NULL
ORDER BY
d.due_date DESC,
d.transaction_number,
p.last_name,
p.first_name;
ORDER BY 1, 2;


DECLARE @out_file AS INT;
Expand Down

0 comments on commit e44f964

Please sign in to comment.