Alan
Please see my hit at this below.
I've not generated columns in MB but: as I see it, your column name, as
a char string, can't have (presumably) integer I, so you must convert I
to a string. As you use this twice, I convert it once and use the new
string var. However, I don't know the data type of your new column; if
it's numeric then your original "set" code is correct; if not, then you
need to convert I before concatenating into a string, as I have
illustrated. It's also possible that you may have to convert this
equation to a string first, before assigning it to the new column.
As for the whole col. Name, I imagine you have to build IT first, before
adding it to the table.
Also, I've used a For loop for conciseness.
HTH
Terry McDonnell
For I = 1 to 9
lcColNum = RTRIM&( STR$( I))
lcColName = "Q" + lcColNum
Add Column pareastable ( lcColName )
From sectionstuff1q05
Set To Q0 + lcColNum + _forecast
Where COL50 = COL1
Next
-----Original Message-----
From: Alan Gunn [mailto:[EMAIL PROTECTED]
Sent: 17 June 2005 19:01
To: Terry McDonnell
Subject: MI-L column heading
Hi all,
I am trying to build a column heading in a loop with an int counter.
Here is the sample code:
Do While i < 10
Add Column pareastable (Q+i )From sectionstuff1q05 Set To Q0+i+_forecast
Where COL50 = COL1
i = i+1
loop
I have also tried to use a string variable for the column heading, but
still no dice. I get an error message either way saying "Could not
convert data".
The first column with the int counter works, it's the second that I am
having trouble with. I know that a column name isn't a string, and I am
probably missing something simple.
The question would be how do I build a column heading with a variable in
the middle?
Thanks,
Alan
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 16828