Hi Alistair,

That's because you can't trim a NUMBER field, you can only run mathematical
operations on it.  But what you can do is cast the number as a string
(STR$), then truncate it (RIGHT$), then cast it back to a number (VAL).


Update MYTABLE set MYCOLUMN = val(right$(str$(MYCOLUMN), 4))


Should do the trick.

Cheers,

---------------------
Peter Zyczysnski
Analyst Programmer
Insight GIS
Hobart, Australia
Ph +61 (3) 6234-5833
[EMAIL PROTECTED]
www.insightgis.com.au



-----Original Message-----
From: Alistair Hart [mailto:[EMAIL PROTECTED] 
Sent: Monday, 25 July 2005 2:03 PM
To: >; [EMAIL PROTECTED]
Subject: MI-L Right$ argument 1 has invalid type

Hi (again...) folks!
 
Once again, having checked the user guide and MI-L archives I am stumped.
 
I have a 9 digit column (integer) which I would like to trim to the last 4
digits...
What should be a relatively simple operation is just not working! I'm sure
it's a user error!
 
I have MI 7.8 and a table with 6000 records in it.
The field I wish to trim has 9 digits for every record, and none exceed the
value 390000000.
Each time I try (and there's been a few...) to trim the values in this field
using
 
Right$(SLA03_Code,4)
 
I get the following error message:
 
Right$: argument 1 has invalid type
 
 
Has anyone else had this problem or can you see the error (that may well be
patently obvious to all you old hands...) that i'm making?
 
Thankyou,
 
Alistair.
 

***************************************************
Alistair Hart
GIS Project Officer
Health Surveillance
Tropical Public Health Unit Network
PO Box 1103
Cairns QLD 4870
Ph: 0740 503 628
Fax: 0740 311 440
E: [EMAIL PROTECTED]
 
"Disease ecology is inherently integrative and spatial, and GIS provides the
environment in which the biophysical, social, behavioural, and cultural
worlds can be combined for a systemic understanding of health and disease"
 
Tim U. Sunday (2000)



****************************************************************************
*******
This email, including any attachments sent with it, is confidential and for
the sole use of the intended recipient(s).  This confidentiality is not
waived or lost, if you receive it and you are not the intended recipient(s),
or if it is transmitted/received in error.

Any unauthorised use, alteration, disclosure, distribution or review of this
email is prohibited.  It may be subject to a statutory duty of
confidentiality if it relates to health service matters.

If you are not the intended recipient(s), or if you have received this email
in error, you are asked to immediately notify the sender by telephone or by
return email.  You should also delete this email and destroy any hard copies
produced.
****************************************************************************
*******


---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 17245

Reply via email to