...
When building mysql datasets, the startDate and endDate will parameters use x date with a time of 00:00:00. Consider this when building a dataset. If the time period is January 1, 2012 thru January 31, 2012, you would want user to enter the user enters those as start and endDate parameters, use a query like this:. The mysql will need to add 1 date to endDate to include that last day's data.
Code Block |
---|
select o.value_text from obs o, encounter e where o.obs_datetime >= :startDate and o.obs_datetime <= addDate(:endDate,1) and e.location_id = :location and o.encounter_id = e.encounter_id and e.encounter_type = 13 and o.concept_id = 6541 and o.voided = 0 and e.voided = 0 from obs o, encounter e |