Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
&nbsp; and o.obs_datetime <= addDate(:endDate,1)
&nbsp; and e.location_id = :location&nbsp;
&nbsp; and o.encounter_id = e.encounter_id&nbsp;
&nbsp; and e.encounter_type = 13&nbsp;
&nbsp; and o.concept_id = 6541 &nbsp;
&nbsp; and o.voided = 0
&nbsp; and e.voided = 0
from obs o, encounter e &nbsp;