PDA

View Full Version : date functions


ON
07-02-2003, 01:42 PM
You're right : I missed a last step that will give (A or B) and (C or D) and
that leads to your solution.

All my excuses

Regards.

"andrewst" <member14183@dbforums.com> a écrit dans le message news:
3063449.1057086382@dbforums.com... Originally posted by On Hi all, I think that the question is not quite clear. So I guest that it concerns the available prices to be applied for May of the current year. The solution consist to solve the following logical statements : Statement A : effective_start_date is before May of the year Statement B : effective_start_date is in May of the year Statement C : effective_end_date is in May of the year Statement D : effective_end_date is after May of the year The selected prices must satisfy this date interval condition : (A and C) or (A and D) or (B and C) or (B and D) that can be covered by : (A and (C or D)) or (B and (C or D)) So try this : select price,effective_start_date,effective_end_date from pricing where (to_char(effective_start_date,'YYYYMM') '200305')) or (to_char(effective_start_date,'YYYYMM') = '200305' and (to_char(effective_end_date,'YYYYMM') = '200305' or to_char(effective_end_date,'YYYYMM') > '200305')) Regards How does that 4-condition solution improve on the 2-condition solution I gave earlier? :- WHERE effective_start_date <= TO_DATE('31-MAY-2003') AND effective_end_date >= TO_DATE('01-MAY-2003') Less is more... -- Posted via http://dbforums.com


MyLounge.com Site Map
Forum: Cars, Cell Phone, Database, Games, Home Improvement, IT, Music, School, Sports, Web Design, Web Server, Weight Loss

The MyLounge.com forum is intended for informational use only and should not be relied upon and is not a substitute for any advice. The information contained on MyLounge.com are opinions and suggestions of members and is not a representation of the opinions of MyLounge.com. MyLounge.com does not warrant or vouch for the accuracy, completeness or usefulness of any postings or the qualifications of any person responding. Please consult a expert or seek the services of an attorney in your area for more accuracy on your specific situation. Please note that our forums also serve as mirrors to Usenet newsgroups. Many posts you see on our forums are made by newsgroup users who may not be members of MyLounge.com Term of Service