Missing Date of Information: Difference between revisions

From IMSMA Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 35: Line 35:
fieldreport.dateofreport IS NULL  AND
fieldreport.dateofreport IS NULL  AND
hazardinfoversion.link_only =  '0'
hazardinfoversion.link_only =  '0'
ORDER BY
fieldreport.fieldreport_localid ASC
</pre>
'''Hazard reduction'''
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>
SELECT
fieldreport.fieldreport_localid,
fieldreport.dateofreport AS `Date of Information`,
fieldreport.reportreceiveddate AS `Data Entry Date`,
fieldreport.reportcompleteddate AS `Submitted Date`,
fieldreport.reportverifieddate AS `Approved Date`,
fieldreport.dataenterer AS `Data enterer`,
fieldreport.verifiedby AS `Approved by`,
hazreducinfoversion.startdate,
hazreducinfoversion.enddate,
hazreducinfoversion.hazreduc_localid
FROM
fieldreport
Inner Join hazreducinfoversion ON fieldreport.fieldreport_guid = hazreducinfoversion.fieldreport_guid
WHERE
fieldreport.dateofreport IS NULL  AND
hazreducinfoversion.link_only =  '0'
ORDER BY
ORDER BY
fieldreport.fieldreport_localid ASC
fieldreport.fieldreport_localid ASC

Revision as of 10:10, 12 February 2014

If Date of Information is missing it has to be set depending on type of item. If the Data Entry Form that misses Date of Information is an Activity or Education then you might be able to use End date.

SELECT
fieldreport.fieldreport_localid,
fieldreport.dateofreport AS `Date of Information`,
fieldreport.reportreceiveddate AS `Data Entry Date`,
fieldreport.reportcompleteddate AS `Submitted Date`,
fieldreport.reportverifieddate AS `Approved Date`,
fieldreport.dataenterer AS `Data enterer`,
fieldreport.verifiedby AS `Approved by`
FROM
fieldreport
WHERE
fieldreport.dateofreport IS NULL
ORDER BY
fieldreport.fieldreport_localid ASC

Hazard

With this result set you can show the country which Hazards are affected and figure out a solution

SELECT
fieldreport.fieldreport_localid,
fieldreport.dateofreport AS `Date of Information`,
fieldreport.reportreceiveddate AS `Data Entry Date`,
fieldreport.reportcompleteddate AS `Submitted Date`,
fieldreport.reportverifieddate AS `Approved Date`,
fieldreport.dataenterer AS `Data enterer`,
fieldreport.verifiedby AS `Approved by`,
hazardinfoversion.hazard_localid
FROM
fieldreport
Inner Join hazardinfoversion ON fieldreport.fieldreport_guid = hazardinfoversion.fieldreport_guid
WHERE
fieldreport.dateofreport IS NULL  AND
hazardinfoversion.link_only =  '0'
ORDER BY
fieldreport.fieldreport_localid ASC

Hazard reduction

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

SELECT
fieldreport.fieldreport_localid,
fieldreport.dateofreport AS `Date of Information`,
fieldreport.reportreceiveddate AS `Data Entry Date`,
fieldreport.reportcompleteddate AS `Submitted Date`,
fieldreport.reportverifieddate AS `Approved Date`,
fieldreport.dataenterer AS `Data enterer`,
fieldreport.verifiedby AS `Approved by`,
hazreducinfoversion.startdate,
hazreducinfoversion.enddate,
hazreducinfoversion.hazreduc_localid
FROM
fieldreport
Inner Join hazreducinfoversion ON fieldreport.fieldreport_guid = hazreducinfoversion.fieldreport_guid
WHERE
fieldreport.dateofreport IS NULL  AND
hazreducinfoversion.link_only =  '0'
ORDER BY
fieldreport.fieldreport_localid ASC