Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP SQL Syntax - Tuesday BrainFreeze
Message
From
10/07/2007 13:10:21
 
 
To
10/07/2007 13:01:12
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01238981
Message ID:
01238987
Views:
11
This message has been marked as a message which has helped to the initial question of the thread.
Hey Trace,

How about this? < update > So I'm slow on the draw.
select table1.aid, table1.aagcy, iif(isnull(table2.bvalue),space(20),table2.bvalue) as bvalue ;
    from table1 ;
    left join table2 on (table2.bidv = table1.bidv) ;
    into cursor tempo readwrite
>All fields are character.
>
>Table1 fields:
>
>aid
>aagcy
>adescriptn
>
>Table2 fields:
>
>bidv (same value as aid in table1)
>bname
>bvalue
>
>I want to join the above two tables and do the following:
>
>1. Create a single record for every distinct or unique aid record in table1 whether or not a match exists in table2.
>2. Include the fields: table1.aid, table1.aagcy, table2.bvalue
>3. If there is no matching record in table2, then I want to populate the bvalue field in the joined cursor with an empty string value ''.
>
>I am stuck on a simple sql statement which amazes me. I just can't concentrate today :o( Maybe it was the only 2 hours of sleep I got last night? :o)
Steve Gibson
Previous
Reply
Map
View

Click here to load this message in the networking platform