Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
1 field become 2 fields in newtable
Message
From
30/09/2006 02:25:31
 
 
To
29/09/2006 20:51:53
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01158176
Message ID:
01158352
Views:
29
>Thank you Vladimir,
>
>It worked fine after testing your code, is it possible to do with
>SQL statment only ?
>

vfp9
INSERT INTO newTable;
SELECT Odd.Field amount1,Even.Field amount2 FROM;
(SELECT recno()   pk,Field FROM mytable WHERE recno()%2=1) Odd;
left join ;
(SELECT recno()-1 pk,Field FROM mytable WHERE recno()%2=0) Even;
ON Even.pk=Odd.pk
>**********************************************************************
>
>Paul,
>Try this code
>
>USE NewTable EXCL
>ZAP
>SELECT 0
>USE mytable
>SCAN
> INSERT INTO NewTable (amount1) VALUES (mytable.Field)
> SKIP
> REPLACE amount2 WITH mytable.Field IN NewTable
>ENDSCAN
>>Hi all,
>>
>>I have mytable
>>
>>amount ( char. field) with 2 records
>>10000
>>20000
>>
>>to get newtable with 2 fields with 1 record
>>
>>newtable ( this table already exists with a structure)
>>amount1 amount2
>>10000 20000
>>
>>This is to transfert from mytable 2 records to newtable to get 1 record
>>but 2 fields ( amount1 and amount2 ).
>>
>>TIA for who can help me out.
Previous
Reply
Map
View

Click here to load this message in the networking platform