Skip to Content
0
Former Member
Feb 06, 2014 at 05:34 PM

Query for Count of documents created

700 Views

Hello Experts,

I want a query which will show how many documents created by users for all document types. I created below query

SELECT count (distinct T0.[DocNum]) as 'Total Inv', T1.[U_Name] FROM OINV T0 INNER JOIN OUSR T1 ON T0.UserSign = T1.USERID GROUP BY T1.[U_Name]

union all

SELECT count (distinct T2.[DocNum]) as 'Total Order', T3.[U_Name] FROM ORDR T2 INNER JOIN OUSR T3 ON T2.UserSign = T3.USERID GROUP BY T3.[U_Name]

The results are appearing in one column

I want results in separate column Like below

Total Inv Usersign Total Order

1984 1

487 13 312

263 14 14

619 15 409

3 16 43

1 19

474 20 368

Please advise.

Thanks

Deepak

Attachments

stats.jpg (18.1 kB)