There is, but it seems that you need to loop all the records and for that
you need MapBasic and not the MapBasic window because the last doesn't
support looping.

In MapBasic the syntax would be something like:
Dim sum As Float, counter As Integer
Open Table "mytab"
Fetch First From mytab
Do while not EOT(mytab)
    counter = rowid
    maxvalue = 0
    maxcol = ""
'repeat for all columns
    if mytab.colx > maxvalue then
                maxvalue = colx
                maxcol = "colx"
    end if
    if customer.coly > maxvalue then
                maxvalue = coly
                maxcol = "coly"
    end if
    'Now store the name of the maxcol in your special column
    Update mytabset maxname = maxcol where rowid = counter

Counter = counter + 1
    ' I am not certain whether you have to reset the rowcursor, otherwise
uncomment the next line
' Fetch rec counter
    Fetch Next From mytab
  Loop

Please change and test the code to your needs. Maybe I forgot some variable
declarations.. It is midnight here in the Netherlands so my sight is slowly
letting me down...

Kind regards!

Milo van der Linden

-----Original Message-----
From: Ronning, Christine [mailto:[EMAIL PROTECTED] 
Sent: woensdag 17 augustus 2005 23:50
To: Lars V. Nielsen (GisPro); Dewen Hou
Cc: Mapinfo-L
Subject: RE: MI-L SQL question

Hi Group,

Thanks to all those who replied about the Universal Translator.  I am going
to wait and try to use MapInfo 7.8 on my other workstation, where the files
were originally created, instead of the 7.0 verion which is what I've been
trying to translate with.  Hopefully it works!

My next question is regarding updating a column with a field name in
MapBasic:

I have 4 different age groups with population counts for 92 different
geographic areas I have used the Maximum function to determine which age
group has the highest population count and stored this in an additional
field Now I would like to use the column name (specified age groups) to
attribute another additional field for each record to label which age group
has the highest population count

Ex.

Geography  15-19   20-24   25-29  Max_Count  Max_C_Group
ID

5.01         2       4       7       7           25-29



Is there any way to tell MapBasic how to do this?  Thanks,

Christine







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

Reply via email to