Avatar billede xtom2 Nybegynder
11. januar 2002 - 10:00 Der er 28 kommentarer og
2 løsninger

Relationer og tabeller

Godmorgen! :)

Jeg sidder og arbejder med en kundedatabase i Access. Her har jeg for nyligt lavet en forespørgsel, der viser hvilke kunder, der skal mersælges for perioden 2003. Disse kunder kan ligeledes findes ved søgning i vor faktura-tabel. Mit problem er, at en kunde der f.eks. er blevet solgt på flere områder/amter, står listet flere gange i forespørgslen - netop grundet de forskellige områdekoder.

Jeg vil gerne have forespørgslen til at slå alle kundens områder sammen til én stor faktura, i stedet for - som det virker nu - at kunden får én faktura pr. område/amt.

Hvis I mangler flere informationer, skal I endelig spørge. Jeg er bare ikke lige verdens sejeste haj til Access :)

Mvh
Xtom` =)
Avatar billede terry Ekspert
11. januar 2002 - 10:04 #1
I could imagine that you are grouping on \"områd\" in your query. Try removing this field and remove th grouping from the report
Avatar billede proaccess Nybegynder
11. januar 2002 - 10:06 #2
Du skal fjerne feltet Område/Amt fra din forespørgsel...

Så der kun grupperes på kundens nummer og navn, og derefter summeres faktura\'erne bare

Jeg går ud fra du har en forespørgsel a\'la:

Område  Kunde  Navn  Total

Og det du skal have er:
Kunde  Navn  Total
Avatar billede xtom2 Nybegynder
11. januar 2002 - 11:00 #3
http://www.tommi.dk/eksperten/access.jpg

Hvis jeg fjerner enten amtskoder eller branche, er problemet der stadig.. Såeh enten fatter jeg nada af hvad I skriver, eller..
Avatar billede terry Ekspert
11. januar 2002 - 11:02 #4
Send me the dB and I will take a look. I need to know which query and report we are talking about and also what EXACTLY you want to see in the final report
dktebrsa@europe.lego.com
Avatar billede terry Ekspert
11. januar 2002 - 11:04 #5
Your query isnt grouping on anything so it is more than likely in the report you are grouping you can just modify the report NOT grouping on \"områd\"/amt
Avatar billede proaccess Nybegynder
11. januar 2002 - 11:05 #6
Prøv at lave følgende forespørgsel:

SELECT Kunde.Kode, Kunde.FirmaNavn, Sum(Faktura.Pris) AS FPris
FROM Kunde INNER JOIN Faktura ON Kunde.Kode=Faktura.Kode
WHERE Faktura.Årgang=2003
GROUP BY Kunde.Kode, Kunde.FirmaNavn;

Så kan du se forskellen...
Avatar billede terry Ekspert
11. januar 2002 - 11:05 #7
another thin, is to necessary to have ALL fields from the tables in the query? I doubt that you are showing them all in the report!
Avatar billede xtom2 Nybegynder
11. januar 2002 - 11:14 #8
terry, it should be in your box right about now.
procaccess, jeg får en manglende værdi på Kunde.FirmaNavn..
Avatar billede terry Ekspert
11. januar 2002 - 11:15 #9
I have received it and will take a look
Avatar billede proaccess Nybegynder
11. januar 2002 - 11:16 #10
brug Kunde.[Firma navn] i stedet... du har jo mellemrum i feltnavnet... FY!!!  ;-)

Avatar billede xtom2 Nybegynder
11. januar 2002 - 11:22 #11
proaccess, i know.. det er ikke mig der oprindeligt lavede databasen :)
Avatar billede terry Ekspert
11. januar 2002 - 11:23 #12
which query and reprot do I need to look at?
Avatar billede xtom2 Nybegynder
11. januar 2002 - 11:33 #13
um the query is called \'Rapport_Relation_2003\'.. I merely want it to display those customers in the \'Faktura\' form, in a way that it shows their totals; i.e. all the fields of work and areacodes on one \"Faktura\" (/Invoice ?)
Avatar billede terry Ekspert
11. januar 2002 - 12:42 #14
Hi xtom>proaccess SELECT gives you the sum (all faktura) for each \"kunde\", doesnt this solve your problem? You cant see all the fields in the other tables when GROUPing in a query. I can alter your query to give you the same as what proaccess has given you butis this what you want?
Avatar billede xtom2 Nybegynder
11. januar 2002 - 12:55 #15
No, I don\'t think so. As far as I can tell that solution still displays the invoices separately in the form \"Faktura\".

What I\'m looking for is that all 2003 invoices are shrunk into one invoice, which then displays the different areacodes, fields of work, etc.

Am I making any sense at all? :)
Avatar billede terry Ekspert
11. januar 2002 - 13:06 #16
xtom\' At the moment the FAKTURA form shows ALL faktura (12369 of them). Then on on a sub form it shows the related KUNDE. There are two more sub forms one of them shows rykker information (per Faktura). So as far as I can see it you cant just modify the record source to the main form so that you get a total faktura or the sub forms will no longer function correctly. You need to make a new form showing just the information you want!

Does that clear things up?
Avatar billede xtom2 Nybegynder
11. januar 2002 - 13:14 #17
..

(That meant \"not really\"). For instance customer no. 10012 has a number of invoices, typed or recorded if you wish, in 2003. I then would like the data on those (year 2003) invoices to be listed on one single invoice, maybe the chronologically first year 2003 invoice. That particular invoice would then show me which area codes and fields of work, the customer is listed with - and at which total price and discount.
Avatar billede terry Ekspert
11. januar 2002 - 13:24 #18
xtom I am sure I know what you want, but I am trying to tell you that without altering the form FAKTURA drastically you can NOT use it.

lets talke the sub form containing rykker information. This information is per FAKTURA, there is a LINK between the main form and the sub form on FAKTURANR. If you make a query showing the total for ALL faktura for customer 10012 for the year 2003 then FAKTURANR no longer exists, youonly have the total (DO YOU UNDERSTAND THAT?) and now because FAKTURANR no longer exists the link to th esub form is lost, so you canNOT display rykker information.......

hwo does that help?


Avatar billede terry Ekspert
11. januar 2002 - 13:24 #19
talke = take
Avatar billede terry Ekspert
11. januar 2002 - 13:25 #20
YOU NEED TO MAKE A NEW FORM!
Avatar billede xtom2 Nybegynder
11. januar 2002 - 17:08 #21
I\'ll check back later. Won\'t be long :)
Avatar billede terry Ekspert
14. januar 2002 - 11:32 #22
Hi xtom>Hows it going here?
Avatar billede xtom2 Nybegynder
14. januar 2002 - 18:19 #23
Hi terry :] I haven\'t received any further instructions on what to do in this matter and it seems obvious that ppl would like to keep the current form as it is. On one hand I\'d like to wait a few more days for clarification but I also don\'t mind giving points at this time - theres plenty to take from :)
Avatar billede terry Ekspert
14. januar 2002 - 18:42 #24
hi xtom>I dont mind at all waiting until you are sure you get waht you want. Who\'s ppl?

Do you understand the problems concernig altering the query to this form? If not then I will try and explain in more detail.
Avatar billede xtom2 Nybegynder
14. januar 2002 - 18:57 #25
\'ppl\' (PeoPLe) are the pencil pushers who control this company :]
Avatar billede terry Ekspert
14. januar 2002 - 19:33 #26
OK :o)
Avatar billede terry Ekspert
25. januar 2002 - 18:09 #27
hi xtom>hows things going here?
Avatar billede xtom2 Nybegynder
29. januar 2002 - 13:42 #28
hi again, terr :) sorry for reporting back this late, apparently eksperten.dk didn't send me a notice saying you'd made a comment here :(

anyways, problem solved. The ppl mentioned before brought in some c0der who made the trick work and without changing the form_faktura. however, I'd like to give out points anyway for good support. I trust you'll destroy the copy I sent you, terr? ;)

thanx!

Xtom` =)


PS: I'll make a new question in a few mins - need a font and can't seem to find it anywhere.. and it's pretty damn urgent :(
Avatar billede terry Ekspert
29. januar 2002 - 13:45 #29
OK, and concerning destruction, no problem :o)
Avatar billede terry Ekspert
29. januar 2002 - 13:47 #30
mange tak :o)
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