473,396 Members | 1,871 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,396 software developers and data experts.

Create count to show records Y of X

Hello,
I am working on an asset database. I have it set up where I can put in the order and shows there are "X" assets on this order. How can I make it so when the user is on a partitcular recordset it will show "Y" of "X"

Y = current record set tied to that order
X = all records tied to that order
Jan 20 '20 #1
1 1255
NeoPa
32,556 Expert Mod 16PB
Not easily. The whole concept of Set Theory - upon which most RDBMSs are built - is that there IS no order. They are simply within a set - or Table.

You can sort result data in a Query, but the data must be there before the sorting is applied so Ordinals are not naturally available.

You can have Report Controls that use the Running Sum property so that Ordinals are displayed in the Report, but that is still not within your data.

Essentially Ordinals are anathema to database theory.

All that said, in some circumstances it is possible to produce these within the data. If you have a Field within your data that reflects the order you want to determine the Ordinal by then you can link to a SubQuery of items where the value is less than (or greater than, whatever.) the value in the current record and return a Count() of that SubQuery. Very expensive in processing but can be done.

Obviously that's a kludge. I suspect what you really need to ask yourself is why you think such an item is necessary. I guess it's not impossible but I've been programming in databases for a few years now and the only time I ever had to think about such matters was when people have asked for it, generally before they realised it wasn't a great idea.
Jan 21 '20 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Terri | last post by:
I have a form with a multi-select combo. I dynamically build a SELECT statement, open a report, and set the recordsource to my dynamic SELECT statement. I count the records returned in the report...
15
by: Joachim | last post by:
Hi, Als a beginner, I am looking for a way to show records My code is Private sub Connection( Dim odbconn_Pro As OleDbConnectio Dim odbcomm_Pro As OleDbComman Dim odbdare_Pro As...
7
by: Killer42 | last post by:
Hi all. I dabble with Access, but haven't done anything in-depth for a number of years. What I want to do now is probably a fairly simple JOIN or something, but I just can't recall how to go about...
1
by: sparks | last post by:
I have always just got a count on records and put up a box at the top of the entry forms saying something like 1 of 500 and updating it as you got to 500 of 500. I have never thought of this as...
1
by: Chetana | last post by:
Hi All, I want the query in sql which gives count of records for 2 conditions. Say i have table Category which has CategoryID and SubCatID as 2 columns. Then suppose i want count for the...
1
by: Steve | last post by:
I have to tables Table1 IMS_ID IMS_Name IMS_Descript Table2 P_IMS_ID P_IMS_Name P_IMS_Descript
0
by: bbaamm | last post by:
Imports System.Data Imports System.Data.SqlClient Imports System.Data.OracleClient Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Imports System.Globalization...
6
by: Josh Andrews | last post by:
Hi, how do I write this in sql script. I want to count the records from two or more joined tables and place the result in a new table. Attached is my tables. Thanks....
9
by: Gareth Jones | last post by:
Hi all, Is it possible to show records that happen a specific amount of time after a filtered record? For example: If I was to filter a table of alarms by a keyword, could I show any records...
0
by: Don Quixote | last post by:
Can I refer to the filtered records in Split form view? e.g how to count the records in recordsetclone? Thanks
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.