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

How to number records in data report

22
Hi experts,

I'm using Visual Basic 6, MS Access as Database and Data Environment in my Data Report. I would like to give numbers for my selected data. I separated my data and the numbers then used this code.
Expand|Select|Wrap|Line Numbers
  1. SELECT Customers.CustomerID, Customers.CompanyName, 
  2. (SELECT Count(*) From Customers As Rank Where Rank.CustomerId <= Customers.CustomerId) AS RecordNumber
  3. FROM Customers
  4. ORDER BY Customers.CustomerID;
The problem is it's not produce sequence numbers. Thanks for your help.
Jan 25 '13 #1
5 1801
Rabbit
12,516 Expert Mod 8TB
It would help to see sample data, what your current code is producing, and what it's supposed to produce instead.
Jan 25 '13 #2
mdtam
22
it's produce numbers but not sequence like
3.
5.
2.

I would like it produces like
1.
2.
3.
until the end.
Jan 25 '13 #3
Rabbit
12,516 Expert Mod 8TB
I still need to see the sample data that is producing those results.
Jan 25 '13 #4
mdtam
22
my data looks like this:
Expand|Select|Wrap|Line Numbers
  1. CustomerID    Company Name 
  2.   111           kolapis          
  3.   121           nangka            
  4.   131           atec              
  5.   122           vis               
  6.   152           dell              
let's say I choose atec,dell and nangka. I would like the numbers in data report sequence 1, 2, 3.
Jan 27 '13 #5
Rabbit
12,516 Expert Mod 8TB
There's the issue then. You're filtering for certain companies in your query but not filtering in your subquery as well.
Jan 28 '13 #6

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

Similar topics

5
by: David Gray | last post by:
Greetings all, How can I use ADODB to return all tables in an access DB chosen by the user? I'm able so far to select the DB file and build up my connect string, but I would like to offer a...
0
by: DhavalPatel1983 | last post by:
Hi All, I need ur help in Visual Baisc for Data Report. Description ========= I have one Project Which include One Data Envirnment,Data Report,Form Which contain Listview,Text box, and...
16
palsonjj
by: palsonjj | last post by:
Haai, nw only i've joined here.... i've prob wit Data report... mmm.... how to show the last record frm Database to the Data Report? anyone help me plzzzzz?
2
by: THEAF | last post by:
hi im trying to produce a data report for my computing project. the data report shows information on an examiner such as name & address. It also shows the number of scripts that examiner has...
1
by: sudhirarora | last post by:
I have created one VB Data report for which I am using Data Envoirnment. The commandtext of Data envoirnment's command is changed at runtime and the report comes correctly. However when I run the...
26
by: vishwaskothari | last post by:
I am to make a data report in which I am going to display the records dynamically from the database. No. of record depends on the users input. How can I do this? I think an array of controls can...
2
by: darrel | last post by:
Question: How can i add runtime parameter using DATA REPORT in vb6? For example: i want to show the record of a specific customer personal information only. e.g....
1
by: dontbe | last post by:
Hi Guys, I'm newbie in this forum,.. and i'm having trouble with Data Report. I've been read about How to Create Dynamic Report (thanks to Creative1). But now i have some other trouble (sorry...
3
by: manjeetgrang | last post by:
hi i have designed a data report and data is coming from a temptable.Data in temp table is coming from couple of tables. at run time first time report shows all the data when ever i use report...
0
by: Fidell | last post by:
I am using data report with ms access database. I want to the rptTextbox color to change based on the value of the the recordset field. Eg to appear red if the field is "FAIL" and black if it "PASS"....
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:
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: 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?
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.