Table Relationship Help

T

Tim

I have two tables. One is SalesByMonth and the other contains CreditsByDate. The sales table does not use a full date only the month. The CreditsByDate has a full date (i.e. 1/21/04.) I can't build a query using both tables unless I first establish a relationship. How do I link a full date with a month

Thanks for any help

-Tim
 
N

Nikos Yannacopoulos

Tim,

First make a query on the CreditsByDate table with a
calculated field CrMonth: Month([CreditDate])
Then you can combine this query with the SalesByMonth
table in a new query.

HTH,
Nikos
-----Original Message-----
I have two tables. One is SalesByMonth and the other
contains CreditsByDate. The sales table does not use a
full date only the month. The CreditsByDate has a full
date (i.e. 1/21/04.) I can't build a query using both
tables unless I first establish a relationship. How do I
link a full date with a month?
 
T

Tim Ferguson

The CreditsByDate has a full date (i.e. 1/21/04.) I can't build a
query using both tables unless I first establish a relationship. How
do I link a full date with a month?

You can use a non-equi join

SELECT blah, blah, blah
FROM Credits INNER JOIN Sales
ON Month(Credits.AchievedDate) = Sales.MonthSoldBy

These are pretty uncommon, though, in a properly designed database.

HTH


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top