Normal Topic Can lookups mix field types? (Read 768 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Can lookups mix field types?
Mar 15th, 2006 at 7:03pm
Print Post Print Post  
Can I have one database do a lookup into another database, retrieve a number value from a number formatted field, and place it in a text formatted field?
  

**
Captain Infinity
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Can lookups mix field types?
Reply #1 - Mar 15th, 2006 at 7:19pm
Print Post Print Post  
Yes. The X commands all return strings.

The number will be a raw un-formatted number so you will see something like 937.000000

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Can lookups mix field types?
Reply #2 - Mar 15th, 2006 at 7:20pm
Print Post Print Post  
Thank you, that's excellent.
  

**
Captain Infinity
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Can lookups mix field types?
Reply #3 - Mar 15th, 2006 at 7:21pm
Print Post Print Post  
If you are going to mix types (and even if you are not) , you should use @XLookup - the function and return the value to a variable before assigning it to an LE, as opposed to using the subroutine XLookup.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Can lookups mix field types?
Reply #4 - Mar 15th, 2006 at 7:31pm
Print Post Print Post  
About the formatting...if I wanted to "test" the result (the number in the text field) I would then need to say:

If text_field_holding_a_number="937.000000" then...

instead of:

If text_field_holding_a_number="937" then...

Is that correct?

And if so, does Q&A make the same distinction?  Should I edit this programmed test in Q&A before translation or in Sesame afterwards?  I'd prefer to do it in Q&A if I can.
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Can lookups mix field types?
Reply #5 - Mar 15th, 2006 at 7:34pm
Print Post Print Post  

If @ToNumber(text_field_holding_a_number) = 937 ...
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Can lookups mix field types?
Reply #6 - Mar 15th, 2006 at 8:02pm
Print Post Print Post  
Thank you; I forgot Q&A could do @tonumber.  That should do the trick.
  

**
Captain Infinity
Back to top
IP Logged