Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Crystal Reports 2011 Table Join (data match issue)

Crystal Reports 2011 Table Join (data match issue)

Crystal Reports 2011 Table Join (data match issue)

Crystal Reports 2011. Connecting via ODBC to Pervasive 11 database.

I wish to link 2 tables. The first table is the Master record holder. The second table holds all the underlying detail.

The join is very simple - Table 1.Quote# right outer join Table 2.Quote#_Add. (not enforced).

e.g. Table 1.Quote# 45199 = Table 2.Quote#_add 45199

However the database provides a function allowing additional items to be added to the master record but identified as supplementaries. i.e. they are form part of the master record as a whole but also can be identified as additional to the original value. For example: initial quote $1000 additional damage found during repair to the value of $500. This $500 would be added as a supplementary of the original quote rather than creating a whole other quote.

The way the database does this is simple. It adds a sequential counter. The master record will always be XXXXX.00 and any supplementaries will be sequential XXXXX.01, XXXXX.02 etc.

Supplementaries are infrequent but without the correct join there is holes within our datasets.

So the issue is how do I join the two tables to include any supplementaries?

The current join Table 1.Quote# right outer join Table 2.Quote#_Add. (not enforced). Includes all information but excludes all supplementaries. This would be because the is no longer an exact match once the suffix changes incrementally but I don't know how to work around this.........

Appreciate your help.

RE: Crystal Reports 2011 Table Join (data match issue)

I would probably first try replacing the master record table with a SQL command that includes all the data plus the quote number stripped of the supplementary counter. For instance:

select left(@test,charindex('.',@test) - 1) as QuoteNumberOnly, * from masterrecordtable --SQL Server syntax

Then you can join using the additional field:

command.QuoteNumberOnly = Table 2.Quote#_Add

Depending on your database, this might create a performance issue, but in this case I doubt it. If you try this and it runs too slowly post back and we can work around that.

This also assumes that the original quote will never have a '.' in it.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close