# New users within the past week (formatted usernames)

**URL:** https://meta.discourse.org/t/new-users-within-the-past-week-formatted-usernames/275023
**Category:** Data & reporting
**Tags:** sql-query
**Created:** [1월 18, 2018, 2:58오전 UTC](https://meta.discourse.org/t/new-users-within-the-past-week-formatted-usernames/275023 "2018-01-18T02:58:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![outofthebox](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/outofthebox/32/83708_2.png) [@outofthebox](https://meta.discourse.org/u/outofthebox)
#### Post date: [1월 18, 2018, 2:58오전 UTC](https://meta.discourse.org/t/new-users-within-the-past-week-formatted-usernames/275023/1 "2018-01-18T02:58:20Z")

</div>

Hi, can anyone provide a [data explorer](https://meta.discourse.org/t/32566?silent=true) query that provides a list of all new users within the past week and month? It’d be ideal if the format was so they were already @mentioned, making it easy to copy-paste it into a new post that welcomes these new members to the community.

---

<div class="post-metadata">

### Author: ![mikechristopher](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mikechristopher/32/89135_2.png) [@mikechristopher](https://meta.discourse.org/u/mikechristopher)
#### Post date: [1월 18, 2018, 9:45오전 UTC](https://meta.discourse.org/t/new-users-within-the-past-week-formatted-usernames/275023/2 "2018-01-18T09:45:49Z")

</div>

### New users within the past week (formatted usernames)

This should work ok for you -

```plaintext
    select concat ('@', username)
    from users
    where created_at >= CURRENT_DATE - INTERVAL '1 week'
    order by created_at desc 

```

Just change the 1 week to 1 month or what ever interval you want - you can then export as csv and should be able to copy and paste that into a post.

---

<div class="post-metadata">

### Author: ![jerdog](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jerdog/32/122843_2.png) [@jerdog](https://meta.discourse.org/u/jerdog)
#### Post date: [1월 18, 2018, 1:26오후 UTC](https://meta.discourse.org/t/new-users-within-the-past-week-formatted-usernames/275023/5 "2018-01-18T13:26:55Z")

</div>

### New users within a given time interval (formatted usernames)

> [@mikechristopher](#):
>
> @outofthebox
> 
> This should work ok for you -
> 
> ```plaintext
> select concat ('@', username)
> from users
> where created_at >= CURRENT_DATE - INTERVAL '1 week'
> order by created_at desc 
> 
> ```
> 
> Just change the 1 week to 1 month or what ever interval you want - you can then export as csv and should be able to copy and paste that into a post.

I updated to include column header and parameter so you can easily change the interval:

```
-- [params]
-- string :interval = 1 week

select concat ('@', username) as "new users"
    from users
    where created_at >= CURRENT_DATE - INTERVAL :interval
    order by created_at desc

```
