Denne side indeholder artikler med forskellige perspektiver på Identity & Access Management i private og offentlige organisationer. Artiklerne behandler aktuelle IAM-emner og leveres af producenter, rådgivere og implementeringspartnere.
Hej igen Var lige en anelse for hurtig. Ovennævnte tæller "dato is not null" i tabellen, men jeg skal kun bruge de poster som forespørgslen har udvalgt
Hi Claus, well it wasnt what I was expecting, but none the less! I hope this is what you are after. The query selects the records using the criteria from your form. So I am assuming that it also needs to count those with the same criteria where the date has been entered. If thats the case then the criteria are needed in the count too.
SELECT Hull.HullNumber, MainArea.Department, MainArea.MainArea, Description.Description, Hull_Description.TypeID, Hull_Description.Date1, Hull_Description.TypeID2, Hull_Description.date2, Hull_Description.TypeID3, Hull_Description.date3, Hull_Description.Protocol, Hull_Description.Remarks, (SELECT Count(Hull_Description.Date1) AS CountOfDate1 FROM Hull INNER JOIN ((MainArea INNER JOIN Description ON MainArea.MainID = Description.MainID) INNER JOIN Hull_Description ON Description.ID = Hull_Description.Des) ON Hull.HullId = Hull_Description.HullId GROUP BY Hull.HullNumber, MainArea.Department, MainArea.MainArea HAVING (((Hull.HullNumber) Like [Forms]![Menu]![findhull]) AND ((MainArea.Department) Like [Forms]![Menu]![finddepartment]) AND ((MainArea.MainArea) Like [Forms]![Menu]![findarea]) AND (Not (Count(Hull_Description.Date1)) Is Null))) AS Expr1 FROM Hull INNER JOIN ((MainArea INNER JOIN Description ON MainArea.MainID = Description.MainID) INNER JOIN Hull_Description ON Description.ID = Hull_Description.Des) ON Hull.HullId = Hull_Description.HullId WHERE (((Hull.HullNumber) Like [Forms]![Menu]![findhull]) AND ((MainArea.Department) Like [Forms]![Menu]![finddepartment]) AND ((MainArea.MainArea) Like [Forms]![Menu]![findarea]));
Terry, truely you have deserved your 60 points:-) But for an amateur like my self, above is "too much" to handle. I better settle to count by hand only.
Apart from that, you are right i also needed to count on the other "date fields"
Claus>Cut and paste the above SQL into the query "Hull Query" an dit will give you what you had before AND the count for Date1.
Then in a new field (beside the Date1) enter
CountForDate2:(SELECT Count(Hull_Description.Date2) AS CountOfDate2 FROM Hull INNER JOIN ((MainArea INNER JOIN Description ON MainArea.MainID = Description.MainID) INNER JOIN Hull_Description ON Description.ID = Hull_Description.Des) ON Hull.HullId = Hull_Description.HullId GROUP BY Hull.HullNumber, MainArea.Department, MainArea.MainArea HAVING (((Hull.HullNumber) Like [Forms]![Menu]![findhull]) AND ((MainArea.Department) Like [Forms]![Menu]![finddepartment]) AND ((MainArea.MainArea) Like [Forms]![Menu]![findarea]) AND (Not (Count(Hull_Description.Date2)) Is Null)))
and for date3 CountForDate3:(SELECT Count(Hull_Description.Date3) AS CountOfDate3 FROM Hull INNER JOIN ((MainArea INNER JOIN Description ON MainArea.MainID = Description.MainID) INNER JOIN Hull_Description ON Description.ID = Hull_Description.Des) ON Hull.HullId = Hull_Description.HullId GROUP BY Hull.HullNumber, MainArea.Department, MainArea.MainArea HAVING (((Hull.HullNumber) Like [Forms]![Menu]![findhull]) AND ((MainArea.Department) Like [Forms]![Menu]![finddepartment]) AND ((MainArea.MainArea) Like [Forms]![Menu]![findarea]) AND (Not (Count(Hull_Description.Date3)) Is Null)))
can you give me your email, I have deleted the one you sent!
Synes godt om
Ny brugerNybegynder
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.