Hi am using Date Comparsion in Crystal Report selection Formula as

if (strcmp({?Fromdate},'Nothing')=0 and strcmp({?Todate},'Nothing')=0) then
(
{Command.COMPANYID}={?CompanyId} and
{Command.MODIFIEDDTTM}={Command.MODIFIEDDTTM} and
{Command.CLASSIFICATION} = (if strcmp({?Classification},'Nothing')=0 then {Command.CLASSIFICATION} else {?Classification}) and
{Command.MODIFIEDBY} = (if strcmp({?ModifiedBy},'Nothing')=0 then {Command.MODIFIEDBY} else {?ModifiedBy}) and
{Command.FORMID} = if({?FormId}<> -1) then CDbl({?FormId})else{Command.FORMID}

)
else
(
{Command.COMPANYID}={?CompanyId} and
{Command.MODIFIEDDTTM} <= CDateTime({?Todate}) and
{Command.MODIFIEDDTTM} >= CDateTime({?Fromdate}) and
{Command.CLASSIFICATION} = (if strcmp({?Classification},'Nothing')=0 then {Command.CLASSIFICATION} else {?Classification}) and
{Command.MODIFIEDBY} = (if strcmp({?ModifiedBy},'Nothing')=0 then {Command.MODIFIEDBY} else {?ModifiedBy}) and
{Command.FORMID} = if({?FormId}<> -1) then CDbl({?FormId}) else {Command.FORMID}

)

This formula currently showing records greater than todate. What I am doing wrong

Thanks,