June 12, 2003 at 9:18 am
Hi
I have a sql 2000 database in which i need to join
fldid datatype int
to
productfld datatype text(16)
the productfld default value = ,
so it has values eg. 2435
but also has values eg. 2426,2438,2475
AND
the fldid has values eg. 2426
2438
is this possible
June 12, 2003 at 9:20 am
Hi eily,
quote:
I have a sql 2000 database in which i need to joinfldid datatype int
to
productfld datatype text(16)
the productfld default value = ,
so it has values eg. 2435
but also has values eg. 2426,2438,2475
AND
the fldid has values eg. 2426
2438
should be possible. Take a look at CAST or CONVERT in BOL. Lot of information there
Cheers,
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
June 12, 2003 at 9:57 am
thanks for that but im pretty new to all that
is there any pointers to it ?
cheers
June 12, 2003 at 10:09 am
I think that:
CAST(fldid as VARCHAR)+CAST(productfld as VARCHAR)
will give you the result you are looking for. By using CAST, you are changing them to have the same data types, the + concatenates them.
Hope this helps?
June 12, 2003 at 10:30 am
BTW, why are you using text data type for an "id" column? I think as a rule, you should shy away from using text data type in most columns! Char and VarChar can store up to 8KB of texts, which should be more than enough for an "id" column, columns of text data can be used to store ASCII characters longer than 8 KB.
Search BOL for text data type for more info.
Search BOL for Cast and Convert for examples of how to use them.
June 12, 2003 at 10:36 am
no,
the fldID column is an int datatype
and the productfld is the text field
June 12, 2003 at 6:12 pm
eily,
Are you saying that productfld is a comma-delimited list of product ids?
Cheers,
- Mark
June 13, 2003 at 2:45 am
Hi
yes the productfld is the text field and is comma delimited.
The values of the productfld = values of fldid where fldid is from the lookup table
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply