Research based on secondary analysis of data stored in electronic health records (EHR) has gained popularity, but whether the data are consistent with those collected under a study setting is unknown. The objective is to assess the agreement between data obtained in a prospective study and routine-care data extracted retrospectively from the EHR. We compared the data collected in a longitudinal lifestyle intervention study with those recorded in the EHR system over 5 years. A total of 225 working adults were recruited at an academic institution between 2008-2012, whose EHR data were also available during the same time period. After aligning the participants' study visit dates with their hospital encounter dates, data on blood pressure, body mass index (BMI), and laboratory measurements (including high-density lipoprotein (HDL), low-density lipoprotein (LDL), triglycerides, and total cholesterol) were compared via a paired t-test for equivalence with pre-specified margins. Summary statistics were used to compare smoking status and medication prescriptions. Overall, data were consistent between the two sources (i.e., BMI, smoking status, medication prescriptions), whereas some differences were found in cholesterol measurements (i.e., HDL and total cholesterol), possibly due to different lab assays and subject's fasting status. In conclusion, some EHR data are fairly consistent with those collected in a clinical study, whereas others may require further examination. Researchers should evaluate the consistency and quality of EHR data and compare them with other sources of data when possible.