Hi David,
The only thing I can come up with now, is the question of your column type.
Hopefully your PIN column is Char() !
If it isn't use this instead:
Select * From MstrCondo Where Str$(PIN) like Num into MY_TABLE
NoSelect
Update MY_TABLE Set PIN = Val(Pin(i)+"0000")
Please note that I have changed the way your Select statement has been
build. In this way I'm certain you'll get a quicker Select, because the
selected objects are "highligted". And you also avoid creating a lot of
temporary queries because you'll keep overwriting using a certain name.
I hope this might help you on.
Peter
------------------------------------------------------------------------------------------------
Peter Horsb�ll M�ller, GIS-Developer
Kampsax A/S, GIS Software & Solutions, Rugaardsvej 55, DK-5000 Odense,
Denmark
tlf: + 45 63 13 50 13, dir: + 45 63 13 50 08, fax: + 45 63 13 50 90
mail: [EMAIL PROTECTED], http://www.mapinfo.dk, http://www.kampsax.dk
------------------------------------------------------------------------------------------------
David Windeler wrote:
What I am trying to do is use the Like operator in an SQL select statement
to select certain records from a table. What I want to do is store the
search string in an array and use the Like operator in conjunction with the
array variable and a "%" to complete my selection. Of course all of this is
in a for loop. I have included sample code below. Does anyone know why I
get
the error "Data type mismatch" at the SQL select line?
sub main()
'declare the variables
'---------------------
dim i as integer
dim Num as string
dim Pin(185) as string
'populate the array
'------------------
Pin(1) = "29277"
Pin(2) = "29078"
close all
i = 1
for i = 1 to 3 step 1
open table "H:\Vaughan_curr\MstrCondo.tab" interactive
Num = Pin(i) + "%"
note Num
select * from MstrCondo where PIN like Num into
Selection
' select PIN from MstrCondo where PIN like PinID into
selection
update selection set PIN = Pin(i)+"0000"
commit table MstrCondo
close all
i = i + 1
next
end sub
_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.