NI Home > Community > NI Discussion Forums

LabVIEW

Reply
Member
vochito
Posts: 9
0 Kudos

BOOLEAN OPERATORS ON SQL STRING

I am using LV 8.2 with database toolkit. My application requires to get information from a table by evaluating columns on the table, The data on the colums is numeric and I need to write a MS SQL query capable to do boolean operations to compare them to numeric filters.

 

Any Advice?

Knight of NI
Posts: 18,064

Re: BOOLEAN OPERATORS ON SQL STRING

[ Edited ]

Well, this doesn't really sound like a LabVIEW question. Seems to be more of a T-SQL question. :smileywink:

 

Basically, that's where the WHERE clause (pardon the bad repetition of terms) comes in.  Can you provide an example of what you're looking for? You may want to start here.

Message Edited by smercurio_fc on 09-15-2008 01:07 PM
Member
vochito
Posts: 9
0 Kudos

Re: BOOLEAN OPERATORS ON SQL STRING

thanks for replying , I already look into that link and did not find any boolean operators like AND, OR,  NAND for SQL .

 

I need a query to AND a column on a table and bring all rows to a second table if the AND on the column returns a number different than zero.

 

As I said this will be an AND operation on unsigned numeric values

 

Knight of NI
Posts: 18,064

Re: BOOLEAN OPERATORS ON SQL STRING


vochito wrote:

thanks for replying , I already look into that link and did not find any boolean operators like AND, OR,  NAND for SQL .


Trust me. AND and OR exist for T-SQL. Example: SELECT * FROM tblMyTable WHERE col = 5 AND col7 > 23.

 


I need a query to AND a column on a table and bring all rows to a second table if the AND on the column returns a number different than zero.

 

As I said this will be an AND operation on unsigned numeric values


This doesn't make much sense. You can't AND a single column. And what do you mean "bring all rows to a second table".

 

Member
vochito
Posts: 9
0 Kudos

Re: BOOLEAN OPERATORS ON SQL STRING

This is an example of a query I want to write  :

 

Select * from Table_1 into Table_2 where ((business AND 23) <> 0)

 

In other words I want to apply an AND filter to the business column and pick only the rows for which the evaluation returned a value different than zero.

 

THis is because Business column contains numeric values ranging from 0 to 255 they reperesent a binary array. the number at the right side of AND is also a number which represent another binary array.

Knight of NI
Posts: 18,064

Re: BOOLEAN OPERATORS ON SQL STRING

You are referring to bitwise AND. This is done using the "&" operator. You can see MSDN for more information.