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!

Data Types are not compatible 1

Status
Not open for further replies.

willz99ta

IS-IT--Management
Sep 15, 2004
132
0
0
US
Is there a way to link a table that gives me the "Data types are not compatible" message? I need to use a field in this table in selection formula.

Thanks for your help,
Will
 
you will likely need to use a formula to convert one of the data items to the correct type.
ie: a zip code may be stored as a text item, not a numeric, thus when you try to link it to a numeric item it will not do so unless converted in some way.
this may be done via formula within crystal or via sql/etc
 
You can either convert one using a formula as fisheromacse suggests and then use the formula to link to a main report to a subreport containing the other table, or use a command, where you convert the field in the join clause of the from statement.

-LB
 
How do I use a formula to convert one of the data items to the correct type, have the tables link to each other, and then to use that in the selection formula?

Thanks again,
Will
 
You can't link tables together by formula unless you do it in a command or use the subreport approach.

-LB
 
Hmm, OK, for the sake of argument let's assume that I'm trying to link a table containing the numeric field ICMXVAL.IC_OBJ_ID into my report for the text POLINE.ITEM field.

Can you guide me on how to get that done? I have used SQL queries a few years ago, so let just use the command method (if it's ok with you).

Thanks again for your help!
Will
 
You would have to show samples of the two fields. I'm assuming that you mean the first field is a number field? What kind of database are you using? What version of CR?

-LB
 
Yes the field I mentioned is a number field (Ex 121.00) and the other field is a text field (121). Other than that they are the same.

I am using Crystal Reports 2008

I'm not one hundred percent sure, but I believe our database is an Oracle Database of some type.

Thanks,
Will
 
Using a command as your datasource, you could set up the query something like the following:

select "ICMXVAL"."IC_OBJ_ID", "POLINE"."ITEM"
from "ICMXVAL" inner join "POLINE" on
"ICMXVAL"."IC_OBJ_ID" = to_number("POLINE"."ITEM")

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top