linking empty field 
Author Message
 linking empty field

Hi,

I have two table like this

Table A - Type, StartDate, Price, Remark
Table B - Type, StartDate, Price, Remark

If I make a query to show the records which
a.Type = b.Type, a.StartDate = b.StartDate , a.Price=b.Price
it will work if all the data contain data.

However, I have a situation that some type will not contain StartDate
and Price, so those fields are empty.  When I run the query which I
made by using above criteria, it won't the records contain emtpy
price.

How can I make the linking for Table A and B when they are empty ??
----------------------------
Ivan Lee
http://www.*-*-*.com/



Tue, 08 Mar 2005 00:43:47 GMT  
 linking empty field

Quote:

>Hi,

>I have two table like this

>Table A - Type, StartDate, Price, Remark
>Table B - Type, StartDate, Price, Remark

>If I make a query to show the records which
>a.Type = b.Type, a.StartDate = b.StartDate , a.Price=b.Price
>it will work if all the data contain data.

>However, I have a situation that some type will not contain StartDate
>and Price, so those fields are empty.  When I run the query which I
>made by using above criteria, it won't the records contain emtpy
>price.

>How can I make the linking for Table A and B when they are empty ??

Well... maybe you can't.

Suppose you had 24 records of Type XZ in TableA, with blank StartDate
and blank Price; and 32 records of Type XZ in TableB, also blank.

Which of the 24 should link up with which of the 32? Or do you want
('cause that's what you'll get) all 768 possible combinations?

Do either or both of these tables contain a Primary Key?

                  John W. Vinson[MVP]    
    Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public



Tue, 08 Mar 2005 03:46:01 GMT  
 linking empty field



Quote:

> >Hi,

> >I have two table like this

> >Table A - Type, StartDate, Price, Remark
> >Table B - Type, StartDate, Price, Remark

> >If I make a query to show the records which
> >a.Type = b.Type, a.StartDate = b.StartDate , a.Price=b.Price
> >it will work if all the data contain data.

> >However, I have a situation that some type will not contain StartDate
> >and Price, so those fields are empty.  When I run the query which I
> >made by using above criteria, it won't the records contain emtpy
> >price.

> >How can I make the linking for Table A and B when they are empty ??

> Well... maybe you can't.

> Suppose you had 24 records of Type XZ in TableA, with blank StartDate
> and blank Price; and 32 records of Type XZ in TableB, also blank.

> Which of the 24 should link up with which of the 32? Or do you want
> ('cause that's what you'll get) all 768 possible combinations?

> Do either or both of these tables contain a Primary Key?

This is always the problems of those database, they don't have primary key.
So if we don't use linking,
any query we can do to show records with the conditions below
"three fields Type, StartDate, Price must be same in both table A and B
including they are null or empty string."

Thanks



Tue, 08 Mar 2005 14:43:32 GMT  
 linking empty field


Quote:
>"three fields Type, StartDate, Price must be same in both table A and B
>including they are null or empty string."

Eeeuwww...

ok, you'll need a criterion such as

WHERE (TableA.Type = TableB.Type OR (TableA.Type IS NULL AND
TableB.TYPE IS NULL))
AND
WHERE (TableA.StartDate = TableB.Type OR (TableA.StartDate IS NULL AND
TableB.StartDate IS NULL))
AND
WHERE (TableA.Type = TableB.Price OR (TableA.Price IS NULL AND
TableB.Price IS NULL))

                  John W. Vinson[MVP]    
    Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public



Wed, 09 Mar 2005 01:30:17 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. linking all fields in linked table?

2. Visual Linking: Can link by 2 fields?

3. Visual Linking: Can link by 2 fields?

4. linked table empty

5. HELP: linking txt field with a memo field

6. Linking 2 fields to 1 field

7. Linking 2 fields to the same field

8. Empty fields

9. Finding first not-empty field

10. Queries - To select empty fields

11. Problem with Empty or Null fields in a Table on a Report

12. Empty To Fields in VBA generated email -Why?

 

 
Powered by phpBB® Forum Software