Normal Topic Search question (Read 655 times)
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Search question
Nov 1st, 2012 at 10:54pm
Print Post Print Post  
Hello,
Is it possible to search ("one field" > "another field")  on the same form if they are both number fields?
I'm getting unexpected results...

Thanks for any help.
flip
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Search question
Reply #1 - Nov 2nd, 2012 at 2:01pm
Print Post Print Post  
Yes, it should work fine. Are both fields actually number fields, or is one another type that simply contains numbers?
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: Search question
Reply #2 - Nov 2nd, 2012 at 2:50pm
Print Post Print Post  
Hi Carl,
Yes, both are number fields. Seems it maybe my programing, the unexpected results are some forms do not come up that meet the requirements. I will have to comb through it  with a clear mind.
Thank you for your support.
flip
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: Search question
Reply #3 - Nov 2nd, 2012 at 5:43pm
Print Post Print Post  
Okay, It does not work in a calculated field which is made up of two other fields.
Example

field_1 = (field_2 + field_3)

The retrieve spec placed field_1 is..  "field_1" < "field_4"

I'm working on an inventory reorder level. field_1 is the quantity combination of locations (field_2 & field_3) and field_4 is the minimum required level.

anyone have a better idea?

Thanks
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Search question
Reply #4 - Nov 2nd, 2012 at 6:43pm
Print Post Print Post  
I see your problem.

Proper syntax is:
{field_1 < field_4}


You need to put the statement inside curly braces, and you don't want quotes around the LE names. By putting quotes around the names, you are comparing the literal strings, which is not what you want.

Also: Make sure that field_1 isn't an unbound LE.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Search question
Reply #5 - Nov 2nd, 2012 at 6:46pm
Print Post Print Post  
Instead of comparing the field holding the result (is that one even bound?) in the retrieve spec programming, compare the field to the value of the result. Basically: field4 > (field_2 + field_3).
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: Search question
Reply #6 - Nov 5th, 2012 at 1:27am
Print Post Print Post  
Thank you both for the great ideas and help. I did implement both in my code, works as expected.

Thank you for your support and input.
Flip
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged