Skip to main content

Government Loan Queries (FHA & VA)

This article includes example scenarios for identifying FHA and VA loans based on origination date and loan status.

Updated this week

The following are example scenarios for isolating government-backed loans for analysis, outreach, or reporting purposes. Each scenario includes a sample Cortex Code input and the corresponding SQL example.


Scenario: FHA Loans by Origination Date

Use this scenario to identify active FHA loans originated within a specific time period and exclude loans that are in default.

Cortex Code input:
Write an SQL query that returns FHA loans in [insert state here] where the lien contract date falls within a specified date range and the loan is not in default.

SQL example:

SELECT

address,

city,

county,

deed_price,

lien1_amount,

lien1_loan_type,

lien1_contract_date,

property_type,

year_built,

bedrooms,

bathrooms_total

FROM

XXXXX

WHERE

lien1_contract_date BETWEEN '2023-10-01'

AND '2023-10-31'

AND lien1_loan_type ILIKE '%FHA%'

AND default_yn = 0

ORDER BY

city,

address;


Scenario: VA Loans by Origination Date

Use this scenario to identify active VA loans originated within a specific time period and exclude loans that are in default.

Cortex Code input:
Write an SQL query that returns VA loans in [insert state here] where the lien contract date falls within a specified date range and the loan is not in default.

SQL example:

SELECT

address,

city,

county,

deed_price,

lien1_amount,

lien1_loan_type,

lien1_contract_date,

property_type,

year_built,

bedrooms,

bathrooms_total

FROM

XXXXX

WHERE

lien1_contract_date BETWEEN '2023-10-01'

AND '2023-10-31'

AND lien1_loan_type ILIKE '%VA%'

AND default_yn = 0

ORDER BY

city,

address;


Did this answer your question?