NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
Hameuza
Posts: 5
0 Kudos
Accepted Solution

Teststand SQL reuest get MAX of a Column

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

Active Participant
Rodéric
Posts: 1,058
0 Kudos

Re : Teststand SQL reuest get MAX of a Column

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
Member
Hameuza
Posts: 5

Re : Teststand SQL reuest get MAX of a Column

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

Active Participant
Rodéric
Posts: 1,058
0 Kudos

Re : Teststand SQL reuest get MAX of a Column

Glad I could be of some help!

Rodéric L
Certified LabVIEW Architect
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page