Avatar billede k-let Nybegynder
21. marts 2005 - 16:42 Der er 13 kommentarer og
1 løsning

forespørgsel

Håber nogen kan hjælpe med nedenstående...

Jeg har en database som skal bruges til at lokalisere reservedele på et lager.
Jeg har lavet 2 tabeller til den del jeg har problemer med... én hvor alle produkter med navn og varenr som skal kunne lagerføres er indtastet....den har følgende kolonner:
vareNr
ProduktNavn
AntalColli i produkt

Den anden tabel indeholder så det aktuelle lager af disse varer
og har følgende kolonner:
Id
VareNr
Colli#
Lagerplads

hver vare kan bestå af F.eks 3 colli og vil så have et 3tal i antalColli kolonne i tabel 1
Hvordan laver man en forespørgsel/rapport som fortæller hvilke colli der mangler af hvert produkt.... kan få den til at vise dem der er på lager men dem der er 0 af viser den ikke.
Avatar billede terry Ekspert
21. marts 2005 - 19:19 #1
Why do you need two tables?
Can you please explain what you use each table/field for? Maybe with an example!
Avatar billede k-let Nybegynder
21. marts 2005 - 19:42 #2
I did it with 2 tables because one table is the actual "lager" and the other one is a list of the product availible for Lager also has the name
This way i can add items to table 2 without putting in the name everytime...right
The same product can be in table 2 more than once and because i need to be able to add notes to each entry in this table i need seperate entries for each product
So if i need to put 2 of the vareNr in table 2 the it will look up the name in table 1 and i will be able to add different notes to each item even though they are the same product.....confused
I can send you and example if you want.... tommorow dont have access to it today.
This is working fine...
Can this be done with one table?
Avatar billede terry Ekspert
21. marts 2005 - 19:52 #3
It helps with a bit of background information on your database :o)
Yes I think you will need two tables if you also need.

So what you want is a query showing records from table1 which do NOT have records in table2, is that correct?


If so, try using the Unmatched query Wizard. This will give you a query which you then can use to make the report
Avatar billede k-let Nybegynder
21. marts 2005 - 20:36 #4
yes but the problem comes when a product has say 3 colli and there is only one of #1 and 2 in stock....
vareNr=00019924
ProduktNavn= pc10354
AntalColli=3

there would be 2 entries in table 2
Id=1
VareNr=00019924
Colli#=1
Lagerplads=p1


Id=2
VareNr=00019924
Colli#=2
Lagerplads=p1

It says in table 1 that the product consists of 3 colli so there is none of colli#3
but since it is not in the other table it is not "unmatched"...right.

I want it to tell me that im missing the third colli....is this possible? How can i get it to tell me that in a query

And when i add a new item to table 2 how du i get the colli column to show a list of colli based on the number in AntalColli in table 1 say its 3 then the list should be 1,2 and 3
Avatar billede terry Ekspert
21. marts 2005 - 20:54 #5
Lets say that you drop the AntalColli field. When you add the records to table2 you can always find out how many colli you have by counting the records in table 2 which have the same vareNr.
Avatar billede terry Ekspert
21. marts 2005 - 20:57 #6
I'm off for the evening, I will look again tomorrow, if you can send me you dB I will make an SQL which can show you those where count (table 2) <> AntalColli
Avatar billede k-let Nybegynder
22. marts 2005 - 08:44 #7
I think you may misunderstand me..... the products consists of say 3 colli and these are 3 different boxes... some products consist of 2.... so somewhere i have to tell the database how many colli this product consists of... the example above the product consists of 3 colli then that means that this product is in 3 different boxes ...each box is not the same.....2 boxes of the same product(vareNr) and the same colli are the same....
Avatar billede terry Ekspert
22. marts 2005 - 10:25 #8
can you send your dB

eksperten@NOSPAMsanthell.dk
remove NOSPAM
Avatar billede terry Ekspert
22. marts 2005 - 16:25 #9
Hi Karsten
Have you received the daabase I sent return?
Avatar billede k-let Nybegynder
22. marts 2005 - 18:41 #10
nej jeg er på arbejde men jeg kigger på den i aften når jeg kommer hjem....og vil vende tilbage her iaften eller imorgen men indtil videre kanon....tak for hjælpen
Avatar billede k-let Nybegynder
22. marts 2005 - 18:44 #11
Kan ikke åbne .rar filer på arbejdet...så jeg kan først senere
Avatar billede terry Ekspert
23. marts 2005 - 09:48 #12
thanks Karsten,didnt you send it as a .rar from work?
Let me know if its OK!
Avatar billede k-let Nybegynder
23. marts 2005 - 14:18 #13
no from home...because my mail server doesnt allow databases. Anyway i send you a mail with some feedback on the stuff you came up with...put in an answer to this question and i will give you the points...
Avatar billede k-let Nybegynder
23. marts 2005 - 14:19 #14
sorry the other question
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