Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Mike Yearwood
  Where is Mike Yearwood?
 Toronto
 Canada
 Mike Yearwood
 To: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 Tags
Subject: RE: Unique FieldName
Thread ID: 268458 Message ID: 268612 # Views: 35 # Ratings: 0
Version: Visual FoxPro 6 Category: Databases, Tables and SQL Server
Date: Tuesday, July 13, 2010 3:29:00 PM         
   


> > Hi,
> >
> >
> > Select Fie1, ;
> >        Fei2, ;
> >        Fei3, ;
> >        Fei4, Fei1 From &curView Full Join &CurAcct ;
> >        On fei2 = col2, fei4 = col4 ;
> >        Into Cursor curAccView
> > 

> >
> > Error: Duplicate Field Name
> >
> > Question: How can I make Fei1 owned by &curView and the other Fei1 owned by &curAcct?
> >
> > Alan
> > Ad Majorem Dei Gloriam.
>
>
> Use table aliases:
>
>
> Select t1.Fie1, ;
>        t1.Fei2, ;
>        t1.Fei3, ;
>        t1.Fei4, t2.Fei1 From &curView t1;
>        Full Join &CurAcct t2;
>        On t1.fei2 = col2, t1.fei4 = col4 ;
>        Into Cursor curAccView
> 

>
>
> http://www.junblogs.com/
> http://weblogs.foxite.com/sandstorm36/default.aspx
> http://www.coderisland.com/forum/viewforum.php?f=10

Do not use & for table names in SQL. Use (CurAcct) instead. You would have to use & for things like dynamic where clauses.

Mike Yearwood
Microsoft MVP Visual FoxPro 2008, 2009
We have enough youth. We need a fountain of smart!
There may be many ways to skin a cat, but there are very few right ways to do it.

ENTIRE THREAD

Unique FieldName Posted by Alan Tuscano @ 7/12/2010 12:07:49 PM
RE: Unique FieldName Posted by Bhushan Sahni @ 7/12/2010 12:09:55 PM
RE: Unique FieldName Posted by Cetin Basoz @ 7/12/2010 12:21:32 PM
RE: Unique FieldName Posted by Jun Tangunan @ 7/12/2010 12:22:35 PM
RE: Unique FieldName Posted by Alan Tuscano @ 7/13/2010 3:20:02 AM
RE: Unique FieldName Posted by Christian Tabligan @ 7/15/2010 2:19:44 AM
RE: Unique FieldName Posted by Mike Yearwood @ 7/13/2010 3:29:00 PM
RE: Unique FieldName Posted by Jun Tangunan @ 7/14/2010 12:23:52 AM