AnnetteB1305
Technical User
I have a command I am using on a report I need to join a field on here to a field in a table from my database but it won't let me as they are not compatible data types. The field I am trying to link to is a varchar 32
My command is as follows:-
SELECT `opencall1`.`logdate`, `opencall1`.`closedate`, `opencall1`.`cust_id`, `opencall1`.`priority`, `equipmnt1`.`manufactur`, `pcdesc1`.`info`, `opencall1`.`callref`, `pcdesc1`.`code`,("EN"&mid(`pcdesc1`.`code`,3) ) as code2
FROM ((`swdata`.`opencall` `opencall1` LEFT OUTER JOIN `swdata`.`mdis_oc_asset` `mdis_oc_asset1` ON `opencall1`.`callref`=`mdis_oc_asset1`.`callref`) INNER JOIN `swdata`.`pcdesc` `pcdesc1` ON `opencall1`.`probcode`=`pcdesc1`.`code`) LEFT OUTER JOIN `swdata`.`equipmnt` `equipmnt1` ON `mdis_oc_asset1`.`asset_id`=`equipmnt1`.`equipid`
The field I want to link is the code 2 field but I'm unsure how to set it as a varchar as when I put this after the as code 2 it is throwing an error.
Any help would be appreciated
Thanks
Annette
My command is as follows:-
SELECT `opencall1`.`logdate`, `opencall1`.`closedate`, `opencall1`.`cust_id`, `opencall1`.`priority`, `equipmnt1`.`manufactur`, `pcdesc1`.`info`, `opencall1`.`callref`, `pcdesc1`.`code`,("EN"&mid(`pcdesc1`.`code`,3) ) as code2
FROM ((`swdata`.`opencall` `opencall1` LEFT OUTER JOIN `swdata`.`mdis_oc_asset` `mdis_oc_asset1` ON `opencall1`.`callref`=`mdis_oc_asset1`.`callref`) INNER JOIN `swdata`.`pcdesc` `pcdesc1` ON `opencall1`.`probcode`=`pcdesc1`.`code`) LEFT OUTER JOIN `swdata`.`equipmnt` `equipmnt1` ON `mdis_oc_asset1`.`asset_id`=`equipmnt1`.`equipid`
The field I want to link is the code 2 field but I'm unsure how to set it as a varchar as when I put this after the as code 2 it is throwing an error.
Any help would be appreciated
Thanks
Annette