From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Teststand SQL reuest get MAX of a Column

Solved!
Go to solution
Spoiler
 

Hello,

In Teststand 3.1, I try to get the MAX of a column called  Col1 in the table myTAB.

To do that; I have writen in the Open Statement the following request

SELECT MAX(myTAB.Col1) FROM myTAB" Thanks. Correct execution in teststand

Question : How do I get the result with the SQL Action Step

 

Thank you by advance for your help

0 Kudos
Message 1 of 4
(2,933 Views)

You should try: SELECT MAX(myTAB.Col1) as locals.MAX FROM myTAB   (locals.max would be a TestStand variable)

Rodéric L
Certified LabVIEW Architect
0 Kudos
Message 2 of 4
(2,922 Views)
Solution
Accepted by topic author Hameuza

Hello Rodéric,

 

Thank you very much for the answer.

I tried your suggestion as it is but unfortunatelly Teststand gives back an error because it can't manage correctly the locals.max in the request.

However I tried other may your idea of using the key word "as" :

First I use :

Open Statement : SELECT MAX(myTAB.Col1) as MAXI FROM myTAB

I don't know how teststand manage the "variable" MAXI.

But when I secondly add the step

SQL Action : Get - Retrive Values from record with as Column/Parameter Values:

Name/Number : "MAXI"

Values : Locals.Max

 

It works correctly

 

Thank you a lot

 

Ham

Message 3 of 4
(2,920 Views)

Glad I could be of some help!

Rodéric L
Certified LabVIEW Architect
0 Kudos
Message 4 of 4
(2,917 Views)