Missing Date of Information

From IMSMA Wiki
Revision as of 09:52, 12 February 2014 by Alnaucler (talk | contribs)
Jump to navigation Jump to search

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

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