Skip to content
Advertisement

Use Datediff only if other column has specific value

What is the query for showing days_left in number of days but only if the status is ‘ongoing’, for the status that ‘done’ it just need to display ‘done’ value

Current MySQL Query

Below is my result

Result i want

Advertisement

Answer

In your query, you have equations for calculating your status. You can use the same equation again to specify your days_left, somewhat like:

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement