Forum Discussion
if else condition with between operator
- 10 years ago
Hi
You can do this
if [Month] >= 2 and [Month] <= 4 then "yes" else "no"
/Erik
Hi Erik,
Thanks for your reply.
Yes you are right. This is also a another way to do this.
But wanted to know if we can write this with Between Keyword as I was trying to write.
Any way I will use the way you have suggested.
Thanks
Rajneesh
In Power Query, there's no "between" keyword, you can only use operators to achieve this kind of logic as donsvensen suggested.
See: https://msdn.microsoft.com/en-us/library/mt186365.aspx
Regards,
- Musketeers10 years agoFrequent Visitor
Hi Simon, Thanks for your suggestion. Yes that way it is working. Thanks all for your time and suggestions.
- osiel8 years agoFrequent Visitor
hello, it still works so I've tried and it does not work for me the only thing is that I'm using dates and looking for a date within this range, for example:
Start date: 01-01-18
Final Date: 08-01-18
date to search: 05-01-17
if the date is within the range that returns me a value of $ .100.
thanks for your comments. regards osiel - osiel8 years agoFrequent Visitor
hello, it still works so I've tried and it does not work for me the only thing is that I'm using dates and looking for a date within this range, for example:
Start date: 01-01-18
Final Date: 08-01-18
date to search: 05-01-17
if the date is within the range that returns me a value of $ .100.
thanks for your comments. regards osiel