Filtering a database based on instr rules

  • Hi All,

    I have 2 database. The first database has 20 columns and 40000 rows. The first database looks like:

    Region|Deals

    US|8855

    APAC|7988 7999

    India|6855 6852 6853

    India|7411

    The other database has only 'Deals' column and each row of the second database has just 1 Deal Number unlike the first database where 'Deals' column can have multiple numbers.

    I want to filter the first database where 'Deals' should have numbers that are present in the second database.

    For Eg: If the second database contains 8855 & 6853, I would want the 1st and 3rd entry from first database.

    FYI, the second database also has around 40000 rows.

    Thanks for your help.

    I have also posted the same query at the following link. Just wanted a quick solution.

    Regards,

    Vaibhav

  • I have tried using instr. While running query for reports with lesser number of rows, it works fine. However when running query where Report1 has 40000 rows and Report2 also has close to 40000 rows, my systems crashes.

    Do we have any kind of join query that can do this task?

    Thanks,

    Vaibhav

    SELECT Report1.DEALS, Report2.DEALS, IIf(InStr(1,[Report1]![DEALS],[Report2]![DEALS])>0,"Yes","No") AS Expr1

    FROM Report1, Report2

    WHERE (((IIf(InStr(1,[Report1]![DEALS],[Report2]![DEALS])>0,"Yes","No"))='Yes'));

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply