MySQL Forums
Forum List  »  Stored Procedures

Re: stored proc output problem
Posted by: Rick James
Date: February 28, 2012 01:52PM

> DATE_FORMAT(A.orDt,'%m/%d/%Y') BETWEEN
> DATE_FORMAT(IFNULL(v_begin_date,A.orDt),'%m/%d/%Y') AND
> DATE_FORMAT(IFNULL(v_end_date, A.orDt),'%m/%d/%Y') $$

Eh? Looks like you are making the date hard to compare? Wouldn't this work correctly?
A.orDt BETWEEN
IFNULL(v_begin_date,A.orDt) AND
IFNULL(v_end_date, A.orDt)

What is the datatype of orDT? Hopefully it is DATE. If it is DATETIME, you are leaving out Dec 31, and the compares may not work.

Options: ReplyQuote


Subject
Views
Written By
Posted
1671
February 27, 2012 10:31PM
Re: stored proc output problem
1070
February 28, 2012 01:52PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.