Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use an SQL line in Crystal 11

Status
Not open for further replies.

Rich24

MIS
Oct 5, 2002
52
0
0
US
I can use the following line to link 2 table in SQL: "htrans.servcode[1,3] = immun.immtype[1,3]". This statement looks for the first 3 characters in each field to match instead of the entire field. Is there a way to do this in Crystal? Thanks, Rich
 
If you use a command, you could write it like this:

select htrans.field, htrans.immtype
from htrans inner join immun on
{fn left(htrans.servcode,3)} = {fn left(immun.immtype,3)}

Or you might be able to do this without the {fn }, and just use:

select htrans.field, htrans.field
from htrans inner join immun on
left(htrans.servcode,3) = left(immun.immtype,3)

...depending upon your datasource. The punctuation/syntax is datasource dependent as well.

You could alternatively manage this by using a subreport where you create a formula using the left() function and then link it to the corresponding formula in the main report in the subreport linking screen.

-LB

 
Hi LB,

Sorry for the delay in getting back to you. I've been a little swamped and this had to take a back burner. I just figured out that SQL's could go in a command. I have a little background with SQL and I'm just learning CR. That did the trick. The sub-report is over my head for right now, but I will look into that when I have time.

Thanks for the help!

Rich
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top