Difficult query on 5 tables w/ weighting

  • Sorry for this long one, but I'm stumped.  I have an MS Access database (should be SQL Server, but I'm stuck with it.  I thought this forum could help though.) that contains 5 tables as such:

    CreditUnions

    cu_Employers (bridge table between CreditUnions and Employers)

    Employers

    cu_zips (bridge table between CreditUnions and Zips)

    Zips

    The client wants to be able to search for credit unions that match a selected state AND ( a selected employer OR an entered home zip OR an entered work zip).  The search form has State, Employer, Home Zip, Work Zip fields which are all required.  So basically I need to first find all CreditUnions for the selected state, then search the Employer table for a match, then search the Zips table for a match on the entered Home Zip and the entered Work Zip.  Now here's the rub, the client wants the search to be weighted according to which tables were matched on.  Example: Employer matches rank higher than Home Zip matches, and they rank higher than Work Zip matches.  And they also want to display a contrived field that lists the criteria that were matched on (Employer, Home or Home, Work).  Keep in mind that a single credit union can be matched on all of the entered criteria (Employer, Home Zip, Work Zip).  They also would like this all to take place in the query if possible (They are driving me crazy!).  I stayed up all last night and was not able to come up with anything meaningful.  Any guidance would be greatly appreciated!

    Andrew

  • This was removed by the editor as SPAM

  • Andrew, could you post the schema for each of your tables and if possible a couple of sample rows for each?

    I suspect that this problem isn't too diificult, but more info would be useful.

    Thanks

    Rob

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

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