# Liste des utilisateurs qui font une action

**URL:** <https://discuss.workflowgen.com/t/liste-des-utilisateurs-qui-font-une-action/2035>\
**Category:** General WorkflowGen Discussion\
**Created:** [March 17, 2022, 4:21pm UTC](https://discuss.workflowgen.com/t/liste-des-utilisateurs-qui-font-une-action/2035 "2022-03-17T16:21:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bertrand](https://avatars.discourse-cdn.com/v4/letter/b/a88e4f/32.png) [@Bertrand](https://discuss.workflowgen.com/u/Bertrand)\
**Post date:** [March 17, 2022, 4:21pm UTC](https://discuss.workflowgen.com/t/liste-des-utilisateurs-qui-font-une-action/2035/1 "2022-03-17T16:21:26Z")

</div>

Hello,  
I want to list from the sql server, the list of users who have not done any action for a given period but I don’t know which tables to use.  
Cordially

---

<div class="post-metadata">

**Author:** ![nvarlet](https://avatars.discourse-cdn.com/v4/letter/n/a8b319/32.png) [@nvarlet](https://discuss.workflowgen.com/u/nvarlet)\
**Post date:** [March 21, 2022, 2:39pm UTC](https://discuss.workflowgen.com/t/liste-des-utilisateurs-qui-font-une-action/2035/2 "2022-03-21T14:39:51Z")

</div>

Hello,  
In USERS table, you have a field “DATE\_LAST\_VISIT” that can be useful.

It’s not exactly what you want (connect on WFG != do something) but it can be a first step.

Best regards

---

<div class="post-metadata">

**Author:** ![Bertrand](https://avatars.discourse-cdn.com/v4/letter/b/a88e4f/32.png) [@Bertrand](https://discuss.workflowgen.com/u/Bertrand)\
**Post date:** [March 21, 2022, 4:24pm UTC](https://discuss.workflowgen.com/t/liste-des-utilisateurs-qui-font-une-action/2035/3 "2022-03-21T16:24:37Z")

</div>

Bonjour,  
Merci pour votre aide, c’est un premier pas mais cela devrait me permettre d’avancer.  
Cordialement.

---

<div class="post-metadata">

**Author:** ![ParadimeWeb](https://avatars.discourse-cdn.com/v4/letter/p/8e8cbc/32.png) [@ParadimeWeb](https://discuss.workflowgen.com/u/ParadimeWeb)\
**Post date:** [March 21, 2022, 7:25pm UTC](https://discuss.workflowgen.com/t/liste-des-utilisateurs-qui-font-une-action/2035/4 "2022-03-21T19:25:07Z")

</div>

You should look at the WFACTIVITY\_INST table.

Here is a query that might help you. It will return a list of users with the last time they updated an activity.

```auto
SELECT
	*
FROM (
	SELECT 
		ROW_NUMBER() OVER(PARTITION BY ID_USER_ASSIGNEE ORDER BY AI.DATE_UPDATE DESC) AS RowNumber,
		AI.DATE_UPDATE AS LAST_UPDATE,
		U.*
	FROM 
		USERS U
		JOIN WFACTIVITY_INST AI ON U.ID_USER = ID_USER_ASSIGNEE
	) AS Temp
WHERE
	RowNumber = 1

```

---

<div class="post-metadata">

**Author:** ![Bertrand](https://avatars.discourse-cdn.com/v4/letter/b/a88e4f/32.png) [@Bertrand](https://discuss.workflowgen.com/u/Bertrand)\
**Post date:** [March 22, 2022, 9:00am UTC](https://discuss.workflowgen.com/t/liste-des-utilisateurs-qui-font-une-action/2035/5 "2022-03-22T09:00:51Z")

</div>

> [@ParadimeWeb](#):
>
> ```auto
> SELECT
> *
> FROM (
> SELECT 
> ROW_NUMBER() OVER(PARTITION BY ID_USER_ASSIGNEE ORDER BY AI.DATE_UPDATE DESC) AS RowNumber,
> AI.DATE_UPDATE AS LAST_UPDATE,
> U.*
> FROM 
> USERS U
> JOIN WFACTIVITY_INST AI ON U.ID_USER = ID_USER_ASSIGNEE
> ) AS Temp
> WHERE
> RowNumber = 1
> 
> ```

Merci, je vais essayer cette requête 👌
