I am returning some search results after form submit. All is working fine, until I get to a field that is SMALLDATETIME and allows NULL. At least one of the returned rows ha
Try this,
".date_format(new DateTime( $search_results_option->HardwareAssetLastUpdateTime ),"d/m/Y H:i")."
".$search_results_option->HardwareAssetLastUpdatedByName."
".date_format(new DateTime( $search_results_option->HardwareAssetLastDiscoveryScanDate ),"d/m/Y H:i")." ";
date_format() need the date to be in DateTime format when supplied, you are passing a string.
The other thing may be that $search_results_option is empty
For NULL values:
( $search_results_option->HardwareAssetLastDiscoveryScanDate != null ? date_format(new DateTime( $search_results_option->HardwareAssetLastDiscoveryScanDate ),"d/m/Y H:i") : '' )
This will check for a null value, if it is not null it will display the formatted datetime, els eit will display nothing