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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking tables (different data-types and VIEWs)

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
I need to link tables (from a SQL Server 7.0 database) through fields that are of different data-types - one being an integer - the other being numeric (10, 0). When I try to link the tables in the 'Visual Linking Expert' I get a message indicating that the fields are of different data-types and cannot be linked. Am I able to CAST one of the fields such that I can create a stable link ?
Also I am including a VIEW object in one of my reports and am required to link it (using a JOIN) but am told by the design program that I cannot do this - is there any way round this ?
Thanks in advance.
Steve
 
You can't do anything within Crystal to join across data types. You could try to create a View, Stored Procedure or such outside of Crystal and report on the results.

What is the error you are getting when joining to the view?

In both cases you could create linked subreports, but this is slow and very limited solution. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
StevenK: A report can only be based against 1 type of datasource e.g. a query, a view or a set of tables although you can mix 'flavours' e.g. combine SQL Server and Excel tables. As a result you cannot use a construction which mixes direct table joins and views unless these are SQL views and you've set up the Report Options to enable you to 'see' views, procedures etc.

I prefer to use subreports to do what you are doing as I can create a formula field in the main report designed against a query resultset and use that to join to a data field in the subreport designed against a view.

HTH David C. Monks
david.monks@chase-international.com
Accredited Crystal Decisions Enterprise Partner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top