473,394 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Perform functions on recordset?

Is it possible to perform functions on a recordset (rather than on the
source database), e.g. COUNT, MAX etc

The reason I would like to do this is because I have a hugely complex view
which produces results with over 60 columns of data. I would like to display
all data but also highlight individual "cells" in the table which have the
highest (i.e. MAX) data for each column. I would also like totals at the
bottom of each column.

Obviously I could get the MAX value for each column by performing it on the
SQL data but that would effectively mean running the query twice and would
take twice as long.

Any suggestions?
Aug 8 '05 #1
3 1803
Mika wrote:
Is it possible to perform functions on a recordset (rather than on the
source database), e.g. COUNT, MAX etc
Not without time-and-resource-consuming looping.

The reason I would like to do this is because I have a hugely complex
view which produces results with over 60 columns of data. I would
like to display all data but also highlight individual "cells" in the
table which have the highest (i.e. MAX) data for each column. I would
also like totals at the bottom of each column.

Obviously I could get the MAX value for each column by performing it
on the SQL data but that would effectively mean running the query
twice and would take twice as long.

What database are you using? Does "SQL data" imply that you are using SQL
Server? if so, what version? T-SQL provides CUBE and ROLLUP functionality
which may provide what you are looking for. If you are using SQL Server, you
should look up these terms in Books Online (BOL).

You should test this, but I submit that "running the query twice" would
outperform retrieving the data and looping through it to perform your
aggregations.

You can use subqueries to achieve most of your objectives in a single query.

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Aug 8 '05 #2
This is fairly simple with Reporting Services.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

"Mika" <mi**@hotmail.com> wrote in message
news:OF****************@TK2MSFTNGP14.phx.gbl...
Is it possible to perform functions on a recordset (rather than on the
source database), e.g. COUNT, MAX etc

The reason I would like to do this is because I have a hugely complex view
which produces results with over 60 columns of data. I would like to
display all data but also highlight individual "cells" in the table which
have the highest (i.e. MAX) data for each column. I would also like totals
at the bottom of each column.

Obviously I could get the MAX value for each column by performing it on
the SQL data but that would effectively mean running the query twice and
would take twice as long.

Any suggestions?

Aug 8 '05 #3
Mika,

You might find the QueryRecordsets component I've been working on useful.
Its allows you to issue SQL queries against ADO recordsets. COUNT and MAX
are just two of the many builtin functions supported.

It lets you perform complex SQL SELECT statements including UNION, JOINS,
GROUP BY, HAVING, ORDER BY, sub-queries, functions, aggregates against the
ADO recordsets..

This component allows applications like Visual Basic 6.0 to register ADO
recordsets into a DataSet collection, perform complex SQL queries and return
the results as an ADO recordset.

For a trial download or more information, please visit
http://www.queryadataset.com/recordsets.aspx

Thanks
Adrian Moore

Peersoft

"Mika" <mi**@hotmail.com> wrote in message
news:OF****************@TK2MSFTNGP14.phx.gbl...
Is it possible to perform functions on a recordset (rather than on the
source database), e.g. COUNT, MAX etc

The reason I would like to do this is because I have a hugely complex view
which produces results with over 60 columns of data. I would like to
display all data but also highlight individual "cells" in the table which
have the highest (i.e. MAX) data for each column. I would also like totals
at the bottom of each column.

Obviously I could get the MAX value for each column by performing it on
the SQL data but that would effectively mean running the query twice and
would take twice as long.

Any suggestions?

Aug 9 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jason Gates | last post by:
Dear all I have written a very complex web app for intranet use. It allows users to search a large database and then returns formatted results. I am currently employing a method as below: 1....
2
by: Adam Short | last post by:
I've never needed it before but now I do! Does anyone know if you are able to perform a NOT Like search using Classic ASP ADO? i.e. myData.Filter = "Ref NOT LIKE '*1234*'" by the way this...
3
by: JingleBEV | last post by:
Hi all, I am trying not to use global variable to maintain data consistency. Some procedures and functions will require to pass the recordset object for processing and functions may also return...
2
by: Patrick Gonzalez | last post by:
Is it possible to use the built-in filter functions (ie. "Filter by Selection", etc..) when a form's recordsource has been set to a recordset object during the load event. When I try to do this, I...
5
by: Zlatko Matić | last post by:
Hello. How can I call some functions on MSDE when working in .mdb ? Especially in-line functions which are similar to stored procedures. How can I use MSDE in-line functions as recordsource for...
13
by: MLH | last post by:
Suppose I have this simple SQL string... SELECT tblDrivers.DriverID, tblDrivers.DName FROM tblDrivers WHERE (((tblDrivers.DName) Like "N*")) ORDER BY tblDrivers.DriverID; And suppose that...
2
by: murdock | last post by:
Is there a way to perform functions upon databound data that is to be used in a GridView? For example, in the following code where I am using a GridView to display a resulting asp:SqlDataSource ...
5
by: Dean | last post by:
Has anyone toiled with creating/using alternate domain aggregate functions? I have been messing with that a little. The one recordsource I have been working indicates I get 20 to 40% savings in...
0
NeoPa
by: NeoPa | last post by:
Many of us have noticed that there are some very useful functions available to you when using Excel, but these same functions are not available, as standard, in Access. A particular issue I had...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.