Also, CURRENT VALUE not like 'Not-Detected'
You don't have any wild cards, so make it
  = 'Not-Detected' or
Like '%not-detected%'  (or similar, you get the idea)




Reed Porter
(816) 739-2491
[email protected] <[email protected]>


On Tue, Sep 17, 2013 at 1:54 PM, Dzikowski, Michael <
[email protected]> wrote:

>  Ah, ****
>
> ** **
>
> Taking the 1024 out of single quotes worked. ****
>
> ** **
>
> ** **
>
> ** **
>
> *From:* Dzikowski, Michael
> *Sent:* Tuesday, September 17, 2013 2:52 PM
> *To:* [email protected]
> *Subject:* RE: OT: Noob SQL Question (Conversion failed when converting
> the nvarchar value 'Not-Detected' to data type int.)****
>
> ** **
>
> Any thoughts on why I’m getting these values returned? ****
>
> ** **
>
> ****
>
> ** **
>
> ** **
>
> *Looks like the <= isnt working ? *
>
> * *
>
> ** **
>
> ** **
>
> *From:* [email protected] [
> mailto:[email protected] <[email protected]>] *On
> Behalf Of *Dzikowski, Michael
> *Sent:* Tuesday, September 17, 2013 2:42 PM
> *To:* [email protected]
> *Subject:* [mssms] RE: OT: Noob SQL Question (Conversion failed when
> converting the nvarchar value 'Not-Detected' to data type int.)****
>
> ** **
>
> I was all over the map there, trying different things I was finding on
> google…****
>
> ** **
>
> Thanks! ****
>
> ** **
>
> ** **
>
> *From:* [email protected] [
> mailto:[email protected] <[email protected]>] *On
> Behalf Of *[email protected]
> *Sent:* Tuesday, September 17, 2013 2:14 PM
> *To:* [email protected]
> *Subject:* [mssms] RE: OT: Noob SQL Question (Conversion failed when
> converting the nvarchar value 'Not-Detected' to data type int.)****
>
> ** **
>
> CurrentValue is defined as a nVarchar(max)…. So,****
>
> ** **
>
>   CurrentValue <= 1024 and****
>
> *  CurrentValue <> '%Not%' and*
>
> *  CurrentValue <> 'NULL'*
>
> ** **
>
> Is wrong for a few reasons… ****
>
> ** **
>
> -- needs to be a check of a character, try wrapping the 1024 in single
> quotes****
>
> ** **
>
>   CurrentValue <= ‘1024’****
>
> ** **
>
> -- not sure why this is here?****
>
> *  CurrentValue <> '%Not%' *
>
> * *
>
> *-- if you are trying to exclude NULL values, this would be the proper
> syntax.*
>
> *  CurrentValue IS NOT NULL*
>
> * *
>
> *In summary, try changing your criteria to:*
>
> *  CurrentValue <= ‘1024’*
>
> *AND **  CurrentValue IS NOT NULL*
>
> * *
>
> * *
>
> * *
>
> ** **
>
> ** **
>
> *From:* [email protected] [
> mailto:[email protected] <[email protected]>] *On
> Behalf Of *Dzikowski, Michael
> *Sent:* Tuesday, September 17, 2013 11:04 AM
> *To:* [email protected]
> *Subject:* [mssms] OT: Noob SQL Question (Conversion failed when
> converting the nvarchar value 'Not-Detected' to data type int.)****
>
> ** **
>
> I’m trying to get around this:****
>
> ** **
>
> ** **
>
> Error ****
>
> ** **
>
> Conversion failed when converting the nvarchar value 'Not-Detected' to
> data type int.****
>
> ** **
>
> ** **
>
> SELECT *****
>
>       ,[Netbios_Name0]****
>
>       ,[Description]****
>
>       ,[SettingType]****
>
>       ,[SettingDescriptionRID]****
>
>       ,[RuleNameRID]****
>
>       ,[CurrentValue]****
>
>       ,[ContributingRules]****
>
>   FROM [CM_CAS].[dbo].[v_CIComplianceStatusDetail]****
>
>   ****
>
>   Where RuleNameRID = 'ID-d9a2c1c2-b45e-4d8e-971a-5ddef2720827'****
>
>   and****
>
>   CurrentValue <= 1024 and****
>
> *  CurrentValue <> '%Not%' and*
>
> *  CurrentValue <> 'NULL'*
>
> ** **
>
> ** **
>
> I just want to find all systems that have the Current Value <= 1024****
>
> ** **
>
> ** **
>
> I tried something that isn’t working, ****
>
> ** **
>
> *  CurrentValue <> '%Not%' and*
>
> *  CurrentValue <> 'NULL'*
>
> ** **
>
> Conversion failed when converting the nvarchar value 'Not-Detected' to
> data type int.****
>
> ** **
>
> Is there a way to get around that?  ****
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
>



<<image001.png>>

Reply via email to