Re: Populate with SQL [XPA 2.5]


Florian Groothuis
 

You can’t when you use the distinct function:

 

SELECT distinct Height*1000

From dbo.T_Part

Where PartObsInd=0 and QualityCode = 'K'

 

I could do this:

 

SELECT distinct Height, CAST(Height*1000 as Char(12))

From dbo.T_Part

Where PartObsInd=0 and QualityCode = 'K'

 

But that leaves me with an alpha with decimals.

 

 

Van: main@magicu-l.groups.io [mailto:main@magicu-l.groups.io] Namens Andy Jerison
Verzonden: donderdag 15 juni 2017 18:13
Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] Populate with SQL [XPA 2.5]

 

You can sort on a different column than the one you select. Use SQL like this:

 

SELECT column1,column2,CAST(MyColumn AS CHAR(2))

FROM MyTable

WHERE Something = SomethingElse

ORDER BY MyColumn

 

On Thu, Jun 15, 2017 at 10:22 AM, Florian Groothuis <f.groothuis@...> wrote:

I have to correct that. I have statements with alphanumeric and numeric results so it was either convert or split up.

 

Met vriendelijke groet - With kind regards,

Florian Groothuis
Analist/programmeur
+31 (0)6 21927914

 


meilink.eu
Meilink Beheer Borculo B.V. • Kamerlingh Onnesstraat 1
7271 AZ  Borculo • Nederland • +31 (0)545 253525
KvK 08009803 • Our general terms and conditions apply • Disclaimer

 

Van: main@magicu-l.groups.io [mailto:main@magicu-l.groups.io] Namens Florian Groothuis
Verzonden: donderdag 15 juni 2017 16:12


Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] Populate with SQL [XPA 2.5]

 

I have to in order to get the numbers without decimals.

 

Van: main@magicu-l.groups.io [mailto:main@magicu-l.groups.io] Namens Andy Jerison
Verzonden: woensdag 14 juni 2017 13:37
Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] Populate with SQL [XPA 2.5]

 

Just don't convert the numeric in the ORDER BY clause. 

 

On Jun 14, 2017 2:03 AM, "Florian Groothuis" <f.groothuis@...> wrote:

If you use an “order by” on converted numerics you get this 14,40,7,9. Should be 7,9,14,40 as numeric.

 

I solved this issue by making 2 subtasks, numeric and alphanumeric, and sending an additional parameter. Works now.

 

Van: main@magicu-l.groups.io [mailto:main@magicu-l.groups.io] Namens harry@...
Verzonden: dinsdag 13 juni 2017 20:06


Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] Populate with SQL [XPA 2.5]

 

Use an 'ORDER BY' in your SQL select ?

On Tue, Jun 13, 2017 at 06:30 am, Florian Groothuis wrote:

 

This could work except when the results are numeric values. Casting them as alpha-numeric values messes up the ordering, when I use a numeric virtual as output variable I get this:

 

 

 

Van: main@magicu-l.groups.io [mailto:main@magicu-l.groups.io] Namens harry@...
Verzonden: dinsdag 13 juni 2017 14:48
Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] Populate with SQL [XPA 2.5]

 

Hi Florian,

You could use a direct sql task with the whole sql select as a parameter and build your combobox string from that. You could send this back as the return parameter.

Best regards,
Harry Kleinsmit.

 

Met vriendelijke groet - With kind regards,

Florian Groothuis
Analist/programmeur
+31 (0)6 21927914

 


meilink.eu
Meilink Beheer Borculo B.V. • Kamerlingh Onnesstraat 1
7271 AZ  Borculo • Nederland • +31 (0)545 253525
KvK
08009803 • Our general terms and conditions apply • Disclaimer

 

 

 

 

 

 

 

 

Join main@magicu-l.groups.io to automatically receive all group messages.