PDA

View Full Version : Query between dates



chungtinhlak
04-07-2009, 06:07 AM
I ran a query with an iif statement: if this record from table A is between start date and end date on table B then display the position on table B.

The iif statement works, but for every record on table A, they replicate 2 more (total 3 of the same record), one will have the position (the result that i want) and 2 will not. Can someone tell me why this is.

OBP
04-07-2009, 06:18 AM
The most likely cause is the Join between the Tables, but I would need to see the query to be sure.

chungtinhlak
04-07-2009, 06:33 AM
I can't attach the database it's too big....

There is no Joint in the two table. The secod table just contains the date.

OBP
04-07-2009, 06:42 AM
There should be a connection between the 2 Tables, unless you are using the table for the Parameter dates.
Have you Compacted & repaired the database to make it smaller?

jaykishan_82
04-11-2009, 01:38 AM
Try Inner Join code:

Select * from Table_B inner Join Table_A on uniquerecordof table_B=uniquerecordof table_a
where table_b.date = table_1.date;