Expression not returning value I need

I’m trying to return a field value (in this example course slope) from a table (Data Type: USGA Mens 18). My expression searches for the yardage value of 200 which is >= than the table’s ‘yardage from’ value and <= the table’s ‘yardage to’ value. I would think this expression would return the value “2”. Instead, the expression returns nothing. Why?

I have a separate and similar expression to return the ‘course rating’ value which in this example would be .9. Again, this expression also returns nothing.

FYI… the field values in the table are set to ‘number’.


screen actual

If the “Expression A_difference” is 200 as you say… there is nothing in the DB that has yardage from >= 200 AND yardage_to <= 200.

Thats seems normal
image

1 Like

I don’t understand. Row five (5) in the table has a 'yardage from value of 187 and a yardage to value of 208. 200 falls between these two values. What am I missing here?

image
yardage from > Y means you looking for things where yardage is GREATER than Y

1 Like

Sorry, but I still don’t get it. I have two separate constraints on my search… 1) ‘yardage from’ and ‘yardage to’. I’m looking for ‘yardage from’ > Y and ‘yardage to’ < Y. In this example Y = 200.

200 yards is greater than 187 and less than 208. There is only one row in the table that meets that criteria.

187 <=200 and 208 >= to 200
Yardage from <= Y and yardate to >= Y
You are doing the opposite.

Boy do I feel like a dope. Is there a better way to get the values I’m looking for?

Wait, wait. I think I got it now. In my constraints I need to reverse the >= and the <=. Let me give than a try. Thanks for putting up with me.

1 Like

Nope. That didn’t work either. Sorry, but I’m stumped here. Can anyone suggest how I should write this expression to give me the result I’m looking for? Thanks!

Can you share the last try?
You should have Exactly what I’ve said
Yardage from <= expression’s value
Yardage to >= expression’S value

Oh man. That worked. I think the editor was just slow. I’m getting the correct result now. Thank you guys so much.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.