I'm trying to create a View in SQL 2000 that basically duplicates an existing table, but I need to change one of the field datatypes, so that I can use the View as a data source in a Crystal Report. The field that I need to change from the existing table:
Data Type: varchar
There is a separat table/field that hold equivalent data, but of a different type, that I'm trying to link it to in Crystal:
Data Type: int
I've tried using CONVERT, but I just can't seem to get the syntax right and it keeps giving errors.
Here's the View without doing any conversion:
SELECT CONTEXT, SELECTEDVALUE
I've tried several variations, such as the following, with no luck:
SELECT CONVERT(int(4), CONTEXT)) as CUSTOMERGROUPID, SELECTEDVALUE
What am I doing wroing?