View V_AD_NUM_YRS_GT_AGE_YRS

Code to create the view: V_AD_NUM_YRS_GT_AGE_YRS

The view V_AD_NUM_YRS_GT_AGE_YRS lists the rows in VAERSDATA where the NUMDAYS would actually be greater than the patient’s age (AGE_YRS).

It is used in some queries to get more accurate and meaningful results.

The name means:
AD: All Data
NUM_YRS
Greater than
AGE_YRS

See analysis at:

Field Analysis of NUMDAYS

Field Analysis Of AGE_YRS and NUMDAYS

use VAERS_2019
go


Create view V_AD_NUM_YRS_GT_AGE_YRS
as 
select VAERS_ID
/* 
View for rows where NUMDAYS/NUM_YRS is
greater than the AGE_YRS
*/
, convert ( float, age_yrs )   AGE_YRS
, vax_date
, onset_date
, convert ( INT, NUMDAYS ) NUMDAYS
, ( convert ( float, NUMDAYS ) / 365.0 ) as   NUM_YRS 
, ( convert ( float, NUMDAYS ) / 365.0 ) -
   convert ( float, age_yrs )   as YRS_Diff	
, concat ( symptom_text , symptom_text2 )  as  Symptom_text 
from dbo.[VAERSDATA]
where NUMDAYS IS NOT NULL
and   age_yrs is NOT NULL
AND ( convert ( float, NUMDAYS ) / 365.0 ) -  /* NUM_YRS */
convert ( float, age_yrs )  >  0   /* AGE_YRS */
go


select count(*) Count
from dbo.[V_AD_NUM_YRS_GT_AGE_YRS]

Count:
7284

Leave a Reply

Your email address will not be published. Required fields are marked *