I dette særtema om aspekter af AI ser vi på skiftet fra sprogmodeller til AI-agenter, og hvordan virksomheder kan navigere i spændet mellem teknologisk hastighed og behovet for menneskelig kontrol.
1. Du kan f.eks tilføje et autonummerfelt 2. Gruppering kan du lave i en forespørgsel i menuen Vis > Grupper efter 3. Du kan sortere efter linienr, men det fordrer jo at numrerne er fortløbende indenfor grupperne.
Straks anderledes er det i en rapport. Her kan du tage en ubundet tekstboks fra værktøjslinien og give den postkilden =1 og løbende sum over grupper. Grupperingen lasver du ved at finde ikonet for gruppering og sortering på menulinien.
Adding a line number to a query isnt that easy, unless you have some way placing the records in order, for example using the autonumber field. If you start grouping on other fields then this will very likely put your records (autonumber) out of order.
But as long as you can count the number of records which fall before each record then you can.
Here is a simple example
SELECT Emp1.ID, Emp1.LastName, Emp1.HireDate, (Select Count (*) from Employees Where [ID] < [Emp1].[ID])+1 AS LineNumber FROM Employees AS Emp1 ORDER BY Emp1.ID;
ain't impossible to before (0+1)=1. The records are all in ordre. I have tried:
SELECT Emp1.ID, Emp1.LastName, Emp1.HireDate, (Select Count (*) from Employees Where [ID]+1 < [Emp1].[ID])+2 AS LineNumber FROM Employees AS Emp1 ORDER BY Emp1.ID;
Make a table with the name tblTst an dwith two fields, ID and navn. The ID can be an autonumber but it isnt necessary in this example. If you do use autonumberthen you will need to delete the record with ID = 3 so that you have the follolwing data in the table.
ID navn 1 aaa 2 bbb 4 ddd
Now make a query like this SELECT T.ID, T.navn, (Select count(*) From tblTst WHERE tblTst.ID < T.ID)+1 AS LineNumber FROM tblTst AS T;
which WILL give yu the following result.
ID navn LineNumber 1 aaa 1 2 bbb 2 4 ddd 3
as you can see the LineNumber is not the same as the ID
I would have to control the autonumbered ID, and that I'm not able to either.
But I did try you example and it works, thou the ID numbers must be 1,2,4,5,6,7 etc. and that is a bit tricky as well I think.
It doesn't seems to solve the problem. Instead I think I will try to ADO program me out of it, thou it's a bit tricky as well, but will - over time - make the job. For now I can't see it done but a query, thou it would be the most easy way.
the example I gave was to show you how you can give each record a line number. It is NOT necessary to use an ID column, but it IS neceesary to have some way of placing the records in order. For example, if it was a date time field, you would alter the
WHERE tblTst.ID < T.ID
to
WHERE tblTst.YourDateTimeField < T.YourDateTimeField
and then Order add
OrderBy T.YourDateTimeField
and you can include as many fields as youlike in the WHERE and ORDER BY
I would still have to manuelly plan the first records in some kind of field, as I see it. And that would just me the problem, but I really appreciated the help. It did lead me in a direction to solve the problem. Is it ok if we split the points? mug 20, you 80 and me 20
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.