Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...The enviroment is simple, natural and efficient. The members are competent, educated and professionals..."

Geography

Where in the world do Tek-Tips members come from?

In a recent thread I was advised toHelpful Member!(2) 

philthoms (Programmer)
12 Aug 12 7:48
In a recent thread I was advised to use the crosstab file VFPXTAB which works beautifully for all of my data. However it inserts 'C_' in front of the fields across the top from right to left, eg the account numbers now look like C_1001 instead of 1001. All I would like to do is change them to _1001 etc rather than have the letter C. I realise this is inserted because it is a character field in my original database, so how can I alter this part of the program without upsetting things.
Hope it makes sense and thanks.
Helpful Member!  TeknoSoftInc (Programmer)
12 Aug 12 13:22
I gave you this solution in the other thread, and i tested it and i have used it and it gives you the desired result you are looking for.
i don't know if you tried it or not.. but, try it.. it won't hurt

Quote:


use YourTable in 0 && Or whatever your tablename is called.

&& This will remove duplicate account in case there are dups
select Distinct AccountNo from Yourtable order by AccountNo ;
Into cursor _curAccountFields

Select _curAccountFields

TRY
lcCMD = 'create Table NewTable (' && assuming your new tablename is called NewTable
SCAN
lcfield = ALLTRIM(TRANSFORM(AccountNo)) && Assuming the field for account is AccoutNo
lcField = STRTRAN(lcField,' ','_') && Make the spaces to an underscore
lcField = IIF(ISDIGIT(SUBSTR(lcfield,1,1)),'_','') + lcField && if numeric, put a _ in the front
lcCMD = lcCMD + ALLTRIM(lcField) + ' C(10), ' && build the statement for each field.

ENDSCAN
lcCMD = SUBSTR(lcCMD,1,LEN(lcCMD)-2) + ' ) ' && remove the last 2 delimiters and add the last ) to close
&lcCMD && execute the statement built
IF USED('Newtable') && check the cursor
SELECT Newtable
BROWSE
ENDIF

CATCH TO loexp
MESSAGEBOX(loExp.Message + CHR(13) + ;
'Line: ' + TRANSFORM(loExp.LineNo))
ENDTRY

Ali Koumaiha
TeknoSoft Inc.
Michigan

Helpful Member!  OlafDoschke (Programmer)
12 Aug 12 16:21
Why do you need certain field names? If you bind a cursor or table to a gried, you can set each grid column header caption as you like.

Bye, Olaf.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close