Avatar billede schoesler Nybegynder
11. februar 2004 - 09:50 Der er 8 kommentarer og
1 løsning

Fortløbende nummer i rapport

Hej Eksperter

Hvordan får jeg et fortløbende nummer på mine rapporter?

Rapporterne bliver udskrevet fra en tabel med en query. Kun de records der opfylder kravene udskrives.
Avatar billede terry Ekspert
11. februar 2004 - 12:17 #1
Hi Jan, I'll keep an eye open and see what comes, otherwise I may have a solution, but it will first be when I get home from work!
Avatar billede schoesler Nybegynder
11. februar 2004 - 17:26 #2
= [Page] & " of " & [Pages]
Avatar billede schoesler Nybegynder
11. februar 2004 - 17:29 #3
eller

= [Page] & " / " & [Pages]
Avatar billede terry Ekspert
11. februar 2004 - 19:27 #4
Hi Jan
was that anwer or what? I thought that you wanted a number for each record!
Avatar billede schoesler Nybegynder
11. februar 2004 - 19:57 #5
'terry' Vil gerne have et nr. per record. Mit foreslag er vist kun en halv løsning. Vil gerne høre dit foreslag
Avatar billede terry Ekspert
11. februar 2004 - 20:58 #6
Hi Jan,
It will reuire that you use a query in your report, and if you are doing that already you will need to alter it.

This is an example, hope you can use it to alter your query.
Lets take a table with the first two fields from the following (Last Name and Hire Date)

Last Name    Hire Date    Seniority
-----------------------------------------
Leverling    01-Apr-1992    1
Davolio            01-May-1992    2
Fuller            14-Aug-1992    3
Peacock            03-May-1993    4
Suyama            17-Oct-1993    5
Buchanan    17-Oct-1993    5
King            02-Jan-1994    7
Callahan    05-Mar-1994    8
Dodsworth    15-Nov-1994    9

Now the following SQL will calculate the last column.

SELECT Emp1.LastName, Emp1.HireDate, (Select Count (*) from Employees Where [HireDate] < [Emp1].[HireDate])+1 AS Seniority
FROM Employees AS Emp1
ORDER BY Emp1.HireDate;
Avatar billede terry Ekspert
11. februar 2004 - 20:59 #7
Hope you can see the idea from the SQL, if not get back and I will explain.

If you get it to wok then you now have an extra field in your query/report showing the record number.

mvh
Terry
Avatar billede schoesler Nybegynder
11. februar 2004 - 21:32 #8
'terry' nu er det sådan at jeg har en query kørende og den ser sådan ud. Kan sætte dem sammen?

SELECT InspectionReport.id, InspectionReport.ToBeDone, InspectionReport.NoDone, InspectionReport.AgreedAction, InspectionReport.Procedure, InspectionReport.deck, InspectionReport.engine, InspectionReport.FirstOfficer, InspectionReport.ChiefOfficer, InspectionReport.Captain, InspectionReport.FirstEngineer, InspectionReport.ChiefEngineer, InspectionReport.NotOk, InspectionReport.OK, InspectionReport.IssueNON, InspectionReport.LinkProcedure, InspectionReport.LinkFormular, InspectionReport.CasualRootFactor1, InspectionReport.CasualRootFactor2, InspectionReport.CasualRootFactor3, InspectionReport.NonConformityNumber, InspectionReport.ResponsiblePersion
FROM InspectionReport
WHERE (((InspectionReport.NotOk)=True));
Avatar billede terry Ekspert
11. februar 2004 - 22:10 #9
Jan if you can send me the dB I will see if I can put somethng together for you, not easy without seeing what each field contains.
It will be first when I get home from work tomorrow, hope thats OK
Avatar billede Ny bruger Nybegynder

Din løsning...

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.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester