Home » Community » Newbie corner » Calculated column in a SqlArray
Calculated column in a SqlArray [message #49747] |
Thu, 19 April 2018 17:58 |
Giorgio
Messages: 218 Registered: August 2015
|
Experienced Member |
|
|
Hi there,
in a SqlArray I need to add a column that contains a simple calculation from two other columns, something like this:
...
//lstSamples is the SqlArray control
lstSamples.AddColumn(TOTSAMPLES, t_("Tot number of samples collected"), 10).SetFormat("%2!,n");
lstSamples.AddColumn(GOODSAMPLES, t_("Good samples collected"), 10).SetFormat("%2!,n");
lstSamples.AddColumn(([GOODSAMPLES]/[TOTSAMPLES]), t_("Percentage"), 10).SetFormat("%2!,n");
...
but of course [GOODSAMPLES]/[TOTSAMPLES] does not work.
is there a way to do that?
Thankls,
gio
|
|
|
Re: Calculated column in a SqlArray [message #49748 is a reply to message #49747] |
Thu, 19 April 2018 18:05 |
Giorgio
Messages: 218 Registered: August 2015
|
Experienced Member |
|
|
Oh boy, it was so simple
SqlId percentage("GOODSAMPLES/TOTSAMPLES");
...
lstSamples.AddColumn(TOTSAMPLES, t_("Tot number of samples collected"), 10).SetFormat("%2!,n");
lstSamples.AddColumn(GOODSAMPLES, t_("Good samples collected"), 10).SetFormat("%2!,n");
lstSamples.AddColumn(percentage, t_("Percentage"), 10).SetFormat("%2!,n");
...
|
|
|
Goto Forum:
Current Time: Fri Mar 29 08:57:34 CET 2024
Total time taken to generate the page: 0.01483 seconds
|