19. april 2007 - 13:28Der er
5 kommentarer og 1 løsning
SELECT på anden SELECT
Hej Jeg skal lave en graf der viser antal procentvis antal ok emner per dag. Jeg kan sagtens finde antal ok emner per dag, men problemet opstår når jeg skal formulere Querien videre og have ok emner per dag vist som % af totalt producerede den dag. Min nuværende Query ser sådan ud:
SELECT count([codiceesito]) AS FPY, datevalue(Datafine) AS DateFinished FROM generale WHERE codiceesito=1 And Ripara=0 GROUP BY datevalue(datafine) ORDER BY datevalue(datafine);
Denne returnerer dog kun antal Ok emner per dag.
Nu skal jeg så på en eller anden måde have kørt det med ind så jeg får antal ok emner per dag som % af Totally produced.
Totally Produced findes ved count([codiceesito]) Dvs formlen er (Antal Ok pågældende dag)/Antal totally produced*100
Men kan umiddelbart ikke se hvordan jeg får det med ind i samme Query.
Sorry. First off, it's a confidential company DB, and I'm therefor not allowed to pass it on. Secondly, it's 600+ MB of data =) I was hoping someone could help me, from the information given. It would be easy, afaik, to make a stored procedure doing it, but the assignment dictates that I make it in a query in Access =(
I'm no expert at SQL and I just cant (wont) just try and give an example off the top of my head. So if I were to give a solution I would make a dB with the tables/fields you are actually using. Then I would make a query and test to make sure what I suggested actually worked.
So if you can do this work for me then I can try and find a solution for you. And if you can put some test data in then that also helps.
I'm busy with other things and I dont have much free time, I hope you can understand that.
Oki I send a small part of the Datastructure and Dataset in a DB and 3 Queries I use via mail to u. Feel free to ask me if u need more information. And thanks for taking the time to look into it =)
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.