Changes

Missing Date of Information

1,098 bytes added, 17:15, 10 November 2016
no edit summary
{{TOC right}}==Missing Date of Information ==__NOEDITSECTION__ [[Image:Missing date info.png|1000px|center]]<div align="center">'' How it should NOT look like''</div>If ''Date of Information '' is missing it has to be set depending on type of item. If the Data Entry Form DEF that misses ''Date of Information '' is an Activity or Education then you might be able to use ''End date''.
<pre>
SELECT
fieldreport.fieldreport_localidAS `Form ID`,
fieldreport.dateofreport AS `Date of Information`,
fieldreport.reportreceiveddate AS `Data Entry Date`,
fieldreport.reportverifieddate AS `Approved Date`,
fieldreport.dataenterer AS `Data enterer`,
fieldreport.verifiedby AS `Approved by`,imsmaenum.enumvalue AS `WB status`
FROM
fieldreport
INNER JOIN imsmaenum ON fieldreport.workbenchstatusenum_guid = imsmaenum.imsmaenum_guid
WHERE
fieldreport.dateofreport IS NULL
ORDER BY
fieldreportimsmaenum.fieldreport_localid enumvalue DESC, `Form ID` ASC
</pre>
'''Hazard'''
If you have any output here you need to take action. The queries below help you to identify for which item(s) the rows in the table ''fieldreport'' need to be updated. === Hazard===__NOEDITSECTION__ [[Image:Missing date info2.png|1000px|center]]<div align="center">'' Example of result - it is '''important''' to decide where you may find a date to use that is in chronological order. ''</div>With this result set you can show the country which Hazards are affected and figure out a solution.
<pre>
SELECT
fieldreport.fieldreport_localidAS `Form ID`,
fieldreport.dateofreport AS `Date of Information`,
fieldreport.reportreceiveddate AS `Data Entry Date`,
fieldreport.dataenterer AS `Data enterer`,
fieldreport.verifiedby AS `Approved by`,
imsmaenum.enumvalue AS `WB status`,hazardinfoversion.hazard_localiddataentrydate AS InfoVerDate
FROM
fieldreport
Inner Join INNER JOIN hazardinfoversion ON fieldreport.fieldreport_guid = hazardinfoversion.fieldreport_guidINNER JOIN imsmaenum ON fieldreport.workbenchstatusenum_guid = imsmaenum.imsmaenum_guid
WHERE
fieldreport.dateofreport IS NULL AND
hazardinfoversion.link_only = '0'
ORDER BY
fieldreport.fieldreport_localid InfoVerDate ASC,`Form ID` ASC
</pre>
'''Hazard reduction'''
=== Hazard reduction===__NOEDITSECTION__
With this result set you can show the country which Hazard Reductions are affected and figure out a solution e.g. use End date if NOT NULL
<pre>
</pre>
=== Accident===__NOEDITSECTION__
<pre>
</pre>
=== Victim===__NOEDITSECTION__
<pre>
</pre>
=== MRE===__NOEDITSECTION__
<pre>
</pre>
=== QM===__NOEDITSECTION__
<pre>
</pre>
=== Location===__NOEDITSECTION__
<pre>
</pre>
 
==Future date==__NOEDITSECTION__
Date of Information in the '''future'''. Use one day after the backup was taken in the WHERE.
<pre>
6,632
edits