Getting value from query

I'm having problems with getting a value from a single column call.

select sum(price) as testPrice from sales where quantity > 10

but when I inspect the resultset, I get the following,

[#"5"}>]

Any help is appreciated, thank you.

Answers


That is a very strange result. I am curious why you are not writing the query using ActiveRecord methods:

@testPrice = Sale.sum(:price, :conditions => "quantity > 10")

Need Your Help

How to get references to already instantiated remote objects using WCF?

c# wcf migration remoting

I’ve just read Ingo Rammer's article titled “From .NET Remoting to the Windows Communication Foundation (WCF)”, on the MSDN website (http://msdn.microsoft.com/en-us/library/aa730857(v=vs.80).aspx)....

Delete blank rows based on user selection

excel vba excel-vba

I have a spreadsheet that essentially has two sets of data from two different years that I put into one spreadsheet to compare and line up by adding rows to either set of data. I have a macro already