供参考
((mesReceive.xDateTime >= convert(datetime, @ReceiveDateFrom, 105) or isnull(@ReceiveDateFrom,'')='' or @ReceiveDateFrom ='-1') AND (mesReceive.xDateTime < (convert(datetime, @ReceiveDateTo, 105)+1) or isnull(@ReceiveDateTo,'')='' or @ReceiveDateTo ='-1'))