Ordinal numbers

Acke

Registered User.
Local time
Today, 06:12
Joined
Jul 1, 2006
Messages
158
Hi!

I need to add ordinal numbers (I hope I am using apropriate word, I need to have a row where numbers will go in sequence from 1 to as many as there is data), to this query.

This code returns #Error in column RB.

What am I doing wrong?

Thanks!!!

SELECT [Izlaz roba].ID, [Izlaz roba].ID_RAC, [katbroj] & " " & [naziv] AS Artikal, [Izlaz roba].KOLICINA, [Izlaz roba].CENA, DCount("ID","[izlaz roba]","ID <=" & [Izlaz roba].[ID]) AS RB
FROM Proizvod INNER JOIN [Izlaz roba] ON Proizvod.ID = [Izlaz roba].ID_PROIZVOD IN 'D:\My documents\Japi\OritaColor\Baze\Knjigovodstvo1.1.mdb'
WHERE ((([Izlaz roba].ID_RAC)=[Forms]![Kupci - porudzbine - IzKnjigovodstvoBaze]![IdPorudzbineK]));
 
I don't have an SQL solution for you. But taking look at what you do have, it would seem that you will need an "ORDER BY" clause if your are after an ordinal number.

The next question is the row (record) number. If you create a DAO recordset based on the SQL query, your record number will be your ordinal row number. Regretfully, I can't provide the syntax for an SQL row number. Please look at this Google dump SQL Record Number. Also a dump for this forum based on SQL Record Number.

Does this post by ajetrumpet help?
 
Last edited:
Thank you for very quick response!

I found a sample for what I want to do and I just can't make it work. Do you know why is this SQL working in sample and not working in my case?
 
... having trouble to send file
 
Just as a suggestion, try a simplified SQL statement and get it working. Then try to tackle the full expression.
 

Users who are viewing this thread

Back
Top Bottom