Let me get this right:

Select Wells.Owner, Wells.Owner_Abbr, Wells.Owner_Well_No, YearField_str
from Wells, Production
where Wells.Primary_Key = Production.Primary_Key
and YearField_str > 0 into Selection

---

Try this query:

Select W.Primary_Key, W.Owner, W.Owner_Abbr, W.Owner_Well_No,
P.YearField_str
from Wells W, Production P
where W.Primary_Key = P.Primary_Key
and P.YearField_str > 0

---
You didn't specify the table for the YearField_Str so I assumed that you're
referring to Production table.  If you had SpatialWare/Informix installed
with MapInfo, then it would be much easier.

Good luck!


--
Erick Posner
Join AllAdvantage! Earn $ while you surf anywhere on the Web
http://www.alladvantage.com/go.asp?refid=cbl286

----- Original Message -----
From: Tim Warman <[EMAIL PROTECTED]>
To: Mapinfo-L <[EMAIL PROTECTED]>
Sent: Tuesday, May 02, 2000 9:45 AM
Subject: MI MB using a variable in a select statement


Listers,

Is it possible to use a string variable in a select statement?

The following bit of code doesn't seem to work:

Select Wells.Owner, Wells.Owner_Abbr, Wells.Owner_Well_No, YearField_str
from Wells, Production where
Wells.Primary_Key=Production.Primary_Key and YearField_str>0 into Selection

The YearField_str value has the form Production._19xx, with the actual year
value obtained from a dialog box where the user types in the year they want
to query.

TIA

_____________________________
Tim Warman
Geologist & GIS Specialist
Richard C. Slade & Associates
North Hollywood, CA
(818) 506-0418

----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]


----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to