1,105,625 Community Members

decode using operators?

Member Avatar
amishraa
Junior Poster in Training
68 posts since Oct 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Is there a workaround to this as decode does not seem to allow the use of greater than equal sign
I am trying to show the comment for any days beyond 4 days, not just 4 days.

decode(shipdate-orderdate,'4','This is unsatisfactory!') comments
from orders

Thanks in advance!
:)

Member Avatar
hfx642
Posting Pro
515 posts since Nov 2009
Reputation Points: 164 [?]
Q&As Helped to Solve: 105 [?]
Skill Endorsements: 1 [?]
 
0
 

Consider...

Select Order_Number
From Orders
Where ShipDate - OrderDate >= 4;
Member Avatar
babyDBA
Newbie Poster
10 posts since Sep 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 5 [?]
Skill Endorsements: 0 [?]
 
0
 

You can try this code

select (case when shipdate-orderdated>=4 then 'Unsatisfactory!' else 'Satisfactory!' end)
from orders

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: