Re: Compare Character to numberic
- From: Hugo Kornelis <hugo@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 02 Nov 2005 20:16:04 +0100
On Mon, 31 Oct 2005 09:51:37 -0800, Daniell wrote:
>Hugo,
>Maybe I am doing to conversion wrong or maybe at the wrong place. I am
>attempting to do it on the join command using the cast verb.
>FROM
> SLTEST1.STST1 STST1
> LEFT OUTER JOIN SLTEST1.STST2 STST2
> ON
> STST1.AUTH1 = STST2.AUTH2 AND
> STST1.SLIP1 = CAST( SUBSTRING( STST2.PRN2, 7, 7 ) as numeric )
Hi Daniell,
If there is no bad data in the table, then this should work. With the
data you posted in an earlier message, this should produce no error
(though you wouldn't get any matches on the join condition, as I
explained in my previous message).
If you want me to help you investigate this further, then please do the
following:
1. Copy and paste the output of SELECT @@VERSION in your reply.
2. Also copy and paste the EXACT and COMPLETE text of the error message
you get when running your query from Query Analyzer (if any).
3. Post the complete CREATE TABLE statements for the tables used in the
query. Check www.aspfaq.com/5006 for how you can get the table
definition scripted.
4. Post INSERT statements with some sample data. If the amount of data
in your test database is not prohibitively large, post the complete set
of data (check the link to Vyas' script in www.aspfaq.com/5006).
5. If the query doesn't result in an error but in incorrect output, then
include the expected output from the query as well.
Without the information above, I really can't help you any further than
I've already done.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)
.
- Prev by Date: Re: NULL encountered in math
- Next by Date: Re: Fixed length records
- Previous by thread: Re: NULL encountered in math
- Next by thread: Re: Fixed length records
- Index(es):
Relevant Pages
|
|