locked
WHERE Alphanumeric = Numeric RRS feed

  • Question

  •  

    All,

     

    I'm having trouble with a query where I need to limit a resultset by comparing (using a WHERE clause) a field that is alphanumeric with one that is numeric.  I've tried converting, casting, and case statements, but I either get an overflow error or a big slap on the wrist by SQL Server 2005.  Does anyone have any good solutions to this?  I've been racking my brain for a while now.

     

    Thanks for the help!

    -Scott Mescall

    Thursday, December 20, 2007 2:32 PM

Answers

  • how about this

     

    Select *From yourTable where YourAlphanumerickey=Cast(yournumericcolumn As varchar(20))

     

    Post back the exact error and if possible query

     

    Madhu
    Thursday, December 20, 2007 2:38 PM

All replies

  • how about this

     

    Select *From yourTable where YourAlphanumerickey=Cast(yournumericcolumn As varchar(20))

     

    Post back the exact error and if possible query

     

    Madhu
    Thursday, December 20, 2007 2:38 PM
  • Yes, I think that's going to work just fine.  Sometimes you just need another set of eyes...

     

    Thanks!

    -Scott

     

    Thursday, December 20, 2007 3:05 PM