Normal Topic Xlookup question (Read 1028 times)
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Xlookup question
Jan 26th, 2009 at 7:08pm
Print Post Print Post  
Hello All,
Can I use xlookup and place the retrieved value in a variable? or I'm I trying to go about this the wrong way?

or maybe use a variable in an xlooup?

Thank you 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
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Xlookup question
Reply #1 - Jan 26th, 2009 at 7:16pm
Print Post Print Post  
Use @XLookup. This returns the value and you can put it in a variable.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: Xlookup question
Reply #2 - Jan 26th, 2009 at 8:49pm
Print Post Print Post  
Thank you Erika,
I'm still not getting it, I'm reading the programing guide and from the examples I still can not see it.


vhave is the veriable = @Xlookup((@fn, brp_1, "Inventory!brp_no", "Trk2")  ?
  

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
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Xlookup question
Reply #3 - Jan 26th, 2009 at 9:12pm
Print Post Print Post  
FlipGilbert wrote on Jan 26th, 2009 at 8:49pm:
Thank you Erika,
I'm still not getting it, I'm reading the programing guide and from the examples I still can not see it.


vhave is the veriable = @Xlookup((@fn, brp_1, "Inventory!brp_no", "Trk2")  ?


var vHave as String

       vHave = @Xlookup(@fn, brp_1, "Inventory!brp_no", "Trk2")
       WriteLn(vHave)
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: Xlookup question
Reply #4 - Jan 26th, 2009 at 9:34pm
Print Post Print Post  
ok, WriteLn(vHave)

Trk2 Is a number field so vHave will be Double and not a String correct?
  

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
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Xlookup question
Reply #5 - Jan 26th, 2009 at 9:59pm
Print Post Print Post  
You don't have to WriteLn it out. That's just an example of using it once you have it.

@XLookup always returns a String. If you need it to be numeric then declare the variable as a Double and use @ToNumber to convert the returned value.

var vHave as Double

       vHave = @ToNumber(@Xlookup(@fn, brp_1, "Inventory!brp_no", "Trk2"))
       vHave = vHave * QtyOrdered
       OrderTotal = vHave

...or whatever it is you actually need to do with this number.  Smiley
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: Xlookup question
Reply #6 - Jan 27th, 2009 at 1:30am
Print Post Print Post  
ok, I understand. Thank you (yet again) for your insight and help.

Learning to love the variables!
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