Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Join on different data types
Message
 
To
21/02/2005 13:25:59
Joel Hokanson
Services Integration Group
Bellaire, Texas, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00988924
Message ID:
00988938
Views:
41
>I want to do a remote view and link tables on Vendor_number, however Vendopr_number in one table is Character 9 and it is an INT in other table.
>
>How do you join tables on different data types?
>
>table a Fields invoice_num, char 20 Vendor_number Char 9
>
>Table b Fileds Vendor_number INT vendor_name Chr 35
>
>I am trying to do a view that shows a.Invoice_num and b.Vendor_name
** No optimize for this
SELECT ... FROM TableA;
        .... JOIN TableB ON ALLTRIM(TableA.Vendor_number) = ALLTRIM(STR(TableB.Vendor_number))...

*** Depens of Indexes
SELECT ... FROM TableA;
        .... JOIN TableB ON PADR(ALLTRIM(TableA.Vendor_number),9) = PADR(ALLTRIM(STR(TableB.Vendor_number)),9) ...
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform