By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,307 Members | 1,929 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,307 IT Pros & Developers. It's quick & easy.

Help Query, two table, look for figure between start and end Version: Any Version

P: n/a
Hi,
I don't think my mind in good shape on this today, really need your
expert on this

I got two simple tables without key
Table A has 2 fields, Date and volume, e.g. 1/May/05 and the actual
weight is 500kg

Table B has 3 fields, Period Start date, Period End date, and predict
volume
e.g. Period Start at 1/Apr, Period End at 1/July, predict volume is
1000kg

Now I need to create report to put this two table togther
1st Field - date - 1/May/05
2nd Fileld - actual weight - 500kg
3rd field ( which I don't know how to do it ) - predict volume - 1000kg
( because the date fall between the period start date and period end
date )

I just don't know how to make it works, please help.

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

si*******@gmail.com wrote:
Hi,
I don't think my mind in good shape on this today, really need your
expert on this

I got two simple tables without key
Table A has 2 fields, Date and volume, e.g. 1/May/05 and the actual
weight is 500kg

Table B has 3 fields, Period Start date, Period End date, and predict
volume
e.g. Period Start at 1/Apr, Period End at 1/July, predict volume is
1000kg

Now I need to create report to put this two table togther
1st Field - date - 1/May/05
2nd Fileld - actual weight - 500kg
3rd field ( which I don't know how to do it ) - predict volume - 1000kg
( because the date fall between the period start date and period end
date )

You need to join table A and table B, using a non-equijoin. What this
means is,
since there's no way to say A.date = B.date, you have to find a way to
express
that A.date lies in a period characterised by B.Period_start and
B.Period_end.

It is very straightforward, really. Don't use INNER JOIN. Try
SELECT something_from A, something_from B
WHERE A.date_some_comparison_expression_involving_B.star t_and_B.end

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.