PC Review


Reply
Thread Tools Rate Thread

Comparing non-equal type fields in different tables

 
 
p
Guest
Posts: n/a
 
      21st Dec 2006
I have a custom database table which resides on a SQL server on the
local network. I am comparing some "job numbers" in an accounting
package against this table. The "job numbers" all have the same format
but unfortunately at the bottom of the accounting table there are a few
text entries which are not at all like the normal format for a job
number.

Accounting says it needs these and wont take them out. Is there a way I
can get a relationship going with two different tables when one is text
and the other is numbers?

 
Reply With Quote
 
 
 
 
John Vinson
Guest
Posts: n/a
 
      21st Dec 2006
On 20 Dec 2006 19:57:48 -0800, "p" <(E-Mail Removed)> wrote:

>I have a custom database table which resides on a SQL server on the
>local network. I am comparing some "job numbers" in an accounting
>package against this table. The "job numbers" all have the same format
>but unfortunately at the bottom of the accounting table there are a few
>text entries which are not at all like the normal format for a job
>number.
>
>Accounting says it needs these and wont take them out. Is there a way I
>can get a relationship going with two different tables when one is text
>and the other is numbers?


Unless you'll be multiplying, adding or dividing Job Numbers, I'd
really recommend making them all Text. Then you'll have no problem
joining.


John W. Vinson[MVP]
 
Reply With Quote
 
p
Guest
Posts: n/a
 
      21st Dec 2006
It's a problem of joining two different software packages over ODBC
where I cannot change the table type..

there is absol. no way i can do this?


John Vinson wrote:
> On 20 Dec 2006 19:57:48 -0800, "p" <(E-Mail Removed)> wrote:
>
> >I have a custom database table which resides on a SQL server on the
> >local network. I am comparing some "job numbers" in an accounting
> >package against this table. The "job numbers" all have the same format
> >but unfortunately at the bottom of the accounting table there are a few
> >text entries which are not at all like the normal format for a job
> >number.
> >
> >Accounting says it needs these and wont take them out. Is there a way I
> >can get a relationship going with two different tables when one is text
> >and the other is numbers?

>
> Unless you'll be multiplying, adding or dividing Job Numbers, I'd
> really recommend making them all Text. Then you'll have no problem
> joining.
>
>
> John W. Vinson[MVP]


 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      21st Dec 2006
Look at using CStr or Format to convert the numeric value to a string.

In other words, you'd have something like

WHERE CStr(Table1.Field1) = Table2.Field2

rather than

WHERE Table1.Field1 = Table2.Field2

Note that you can only do this by going into the SQL View of the query (and
you will then be unable to get back to the graphical Design view)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"p" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> It's a problem of joining two different software packages over ODBC
> where I cannot change the table type..
>
> there is absol. no way i can do this?
>
>
> John Vinson wrote:
>> On 20 Dec 2006 19:57:48 -0800, "p" <(E-Mail Removed)> wrote:
>>
>> >I have a custom database table which resides on a SQL server on the
>> >local network. I am comparing some "job numbers" in an accounting
>> >package against this table. The "job numbers" all have the same format
>> >but unfortunately at the bottom of the accounting table there are a few
>> >text entries which are not at all like the normal format for a job
>> >number.
>> >
>> >Accounting says it needs these and wont take them out. Is there a way I
>> >can get a relationship going with two different tables when one is text
>> >and the other is numbers?

>>
>> Unless you'll be multiplying, adding or dividing Job Numbers, I'd
>> really recommend making them all Text. Then you'll have no problem
>> joining.
>>
>>
>> John W. Vinson[MVP]

>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Only include rows where the joined fields from both tables are equal Krzysztof Naworyta Microsoft Access Form Coding 0 24th Aug 2009 08:13 PM
Re: Only include rows where the joined fields from both tables are equal Douglas J. Steele Microsoft Access Form Coding 0 24th Aug 2009 07:46 PM
COMPARING TWO fields of two tables =?Utf-8?B?UGhlb2JpdXM=?= Microsoft Access Queries 2 4th Aug 2006 10:25 AM
Must # of fields in the 2 tables in an Append Query be equal? =?Utf-8?B?Q3JlYXRpdmVJbWFnZXM=?= Microsoft Access Queries 3 1st Oct 2004 05:16 PM
linking tables where data-type is not equal dd Microsoft Access Queries 1 25th Feb 2004 12:28 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:13 AM.