# How Can I Create a segment for contacts that last login date more than 90 days ago?

**URL:** https://forum.mautic.org/t/how-can-i-create-a-segment-for-contacts-that-last-login-date-more-than-90-days-ago/8463
**Category:** Product Support
**Created:** [May 10, 2017, 10:43am UTC](https://forum.mautic.org/t/how-can-i-create-a-segment-for-contacts-that-last-login-date-more-than-90-days-ago/8463 "2017-05-10T10:43:53Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![omar](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@omar](https://forum.mautic.org/u/omar)
#### Post date: [May 10, 2017, 10:43am UTC](https://forum.mautic.org/t/how-can-i-create-a-segment-for-contacts-that-last-login-date-more-than-90-days-ago/8463/1 "2017-05-10T10:43:53Z")

</div>

When I want to set up a Recovery campaign I need to send a message to those users who weren’t login to their accounts more than 90 days ago, there is a contact field connected with my database appear the last login date  
  
  
  
what I need is a segment added any contact exceed 90 days without login every day (updated list) according to the last login contact field data.  
  
  
  
How I can d that, pls help

---

<div class="post-metadata">

### Author: ![omar](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@omar](https://forum.mautic.org/u/omar)
#### Post date: [May 10, 2017, 10:43am UTC](https://forum.mautic.org/t/how-can-i-create-a-segment-for-contacts-that-last-login-date-more-than-90-days-ago/8463/2 "2017-05-10T10:43:53Z")

</div>

When I want to set up a Recovery campaign I need to send a message to those users who weren’t login to their accounts more than 90 days ago, there is a contact field connected with my database appear the last login date

what I need is a segment added any contact exceed 90 days without login every day (updated list) according to the last login contact field data.

How I can d that, pls help

---

<div class="post-metadata">

### Author: ![kgroves](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kgroves/32/560_2.png) [@kgroves](https://forum.mautic.org/u/kgroves)
#### Post date: [May 10, 2017, 11:43am UTC](https://forum.mautic.org/t/how-can-i-create-a-segment-for-contacts-that-last-login-date-more-than-90-days-ago/8463/3 "2017-05-10T11:43:44Z")

</div>

Hi,

I have a lapsed login segment if someone has no interaction in 60 days. I use:

Date Last Active : Less than or equal to: -60 day

It wasn’t obvious if I needed Less than or Greater than, or to use a positive or negative number. The above worked for me trying a few various options. 🙂

---

<div class="post-metadata">

### Author: ![omar](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@omar](https://forum.mautic.org/u/omar)
#### Post date: [May 10, 2017, 11:58am UTC](https://forum.mautic.org/t/how-can-i-create-a-segment-for-contacts-that-last-login-date-more-than-90-days-ago/8463/4 "2017-05-10T11:58:23Z")

</div>

@kgroves when I put days it changes to specific date, what I need determine period and the segment update the contact filtered b this conditions

@MxyzptlkFishStix pls your help

---

<div class="post-metadata">

### Author: ![kgroves](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kgroves/32/560_2.png) [@kgroves](https://forum.mautic.org/u/kgroves)
#### Post date: [May 10, 2017, 12:09pm UTC](https://forum.mautic.org/t/how-can-i-create-a-segment-for-contacts-that-last-login-date-more-than-90-days-ago/8463/5 "2017-05-10T12:09:58Z")

</div>

I think it did that and I just over typed the date with ‘-60 day’

---

<div class="post-metadata">

### Author: ![omar](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@omar](https://forum.mautic.org/u/omar)
#### Post date: [May 10, 2017, 12:34pm UTC](https://forum.mautic.org/t/how-can-i-create-a-segment-for-contacts-that-last-login-date-more-than-90-days-ago/8463/6 "2017-05-10T12:34:57Z")

</div>

@kgroves yeah, but if you go to the filter again it will appear as a date ( 60 days before today) but not a constant factor.

---

<div class="post-metadata">

### Author: ![kgroves](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kgroves/32/560_2.png) [@kgroves](https://forum.mautic.org/u/kgroves)
#### Post date: [May 11, 2017, 6:39am UTC](https://forum.mautic.org/t/how-can-i-create-a-segment-for-contacts-that-last-login-date-more-than-90-days-ago/8463/7 "2017-05-11T06:39:59Z")

</div>

Mine doesn’t do that. I’m using ‘Date Last Active’ field (can’t embed an image only link to one somewhere), perhaps the field type plays a part. I’m on the current version but also had it in 2.7.1

---

<div class="post-metadata">

### Author: ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)
#### Post date: [May 11, 2017, 7:54am UTC](https://forum.mautic.org/t/how-can-i-create-a-segment-for-contacts-that-last-login-date-more-than-90-days-ago/8463/8 "2017-05-11T07:54:01Z")

</div>

@kgroves: Great hint, I didn’t know that this works!

Is there any chance to put in something like a `today()` or `currentDate()`?

---

<div class="post-metadata">

### Author: ![kgroves](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kgroves/32/560_2.png) [@kgroves](https://forum.mautic.org/u/kgroves)
#### Post date: [May 12, 2017, 12:40pm UTC](https://forum.mautic.org/t/how-can-i-create-a-segment-for-contacts-that-last-login-date-more-than-90-days-ago/8463/9 "2017-05-12T12:40:14Z")

</div>

I know there were a number of keywords when i did the research for this like today, yesterday.

---

<div class="post-metadata">

### Author: ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)
#### Post date: [May 15, 2017, 9:42am UTC](https://forum.mautic.org/t/how-can-i-create-a-segment-for-contacts-that-last-login-date-more-than-90-days-ago/8463/10 "2017-05-15T09:42:25Z")

</div>

> [@23032:@kgroves](#):
>
> I know there were a number of keywords when i did the research for this like today, yesterday.

A simple `equals today` works! This is really great!

From time to time, someone asks für birthday mailings. Would’t this be the solution?

---

<div class="post-metadata">

### Author: ![kgroves](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kgroves/32/560_2.png) [@kgroves](https://forum.mautic.org/u/kgroves)
#### Post date: [May 23, 2017, 8:55am UTC](https://forum.mautic.org/t/how-can-i-create-a-segment-for-contacts-that-last-login-date-more-than-90-days-ago/8463/11 "2017-05-23T08:55:53Z")

</div>

Great! yes it would and this is now I found it in the first place 🙂

---

<div class="post-metadata">

### Author: ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)
#### Post date: [May 23, 2017, 10:42am UTC](https://forum.mautic.org/t/how-can-i-create-a-segment-for-contacts-that-last-login-date-more-than-90-days-ago/8463/12 "2017-05-23T10:42:20Z")

</div>

@kgroves: Normally one would store the complete birthdate (including the year). How do you evaluate the current date against the birthday, ignoring the year?

---

<div class="post-metadata">

### Author: ![kgroves](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kgroves/32/560_2.png) [@kgroves](https://forum.mautic.org/u/kgroves)
#### Post date: [May 23, 2017, 10:51am UTC](https://forum.mautic.org/t/how-can-i-create-a-segment-for-contacts-that-last-login-date-more-than-90-days-ago/8463/13 "2017-05-23T10:51:57Z")

</div>

Good question. I have no idea if that can be done easily. I would perhaps split the date components off and do a match on day and a match on month. Unless of course you want to calc age. 🙂

---

<div class="post-metadata">

### Author: ![deddy](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@deddy](https://forum.mautic.org/u/deddy)
#### Post date: [August 31, 2017, 7:37am UTC](https://forum.mautic.org/t/how-can-i-create-a-segment-for-contacts-that-last-login-date-more-than-90-days-ago/8463/14 "2017-08-31T07:37:49Z")

</div>

Guys, found this [https://github.com/mautic/mautic/issues/1818](https://github.com/mautic/mautic/issues/1818) as a very good reference.  
Here’s what I did recently on a new segment to filter inactive contacts [http://prntscr.com/gfa582](http://prntscr.com/gfa582)  
Segment Filters, Date Last Active: `less than or equal : -3 months`  
I also created a new campaign, anyone who’s in Inactive segment then will be removed from my ‘active’ segments.

There’s also ‘Active Again’ segment [http://prntscr.com/gfa6n8](http://prntscr.com/gfa6n8)  
Segment Filters, Date Last Active: `equals : today`  
then a new campaign that removes from inactive segment.

I just started to implement it, hope it works well. And thanks to @PeterTL for opening the possibility of this for me 😃

---

<div class="post-metadata">

### Author: ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)
#### Post date: [August 31, 2017, 9:17am UTC](https://forum.mautic.org/t/how-can-i-create-a-segment-for-contacts-that-last-login-date-more-than-90-days-ago/8463/15 "2017-08-31T09:17:49Z")

</div>

+1

---

<div class="post-metadata">

### Author: ![kgroves](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kgroves/32/560_2.png) [@kgroves](https://forum.mautic.org/u/kgroves)
#### Post date: [August 31, 2017, 2:06pm UTC](https://forum.mautic.org/t/how-can-i-create-a-segment-for-contacts-that-last-login-date-more-than-90-days-ago/8463/16 "2017-08-31T14:06:00Z")

</div>

+1 yep thats the one I might have seen when I mention above with -60. Really should book mark that one! 🙂 thanks

---

<div class="post-metadata">

### Author: ![ospa123](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ospa123/32/3545_2.png) [@ospa123](https://forum.mautic.org/u/ospa123)
#### Post date: [June 19, 2021, 2:40pm UTC](https://forum.mautic.org/t/how-can-i-create-a-segment-for-contacts-that-last-login-date-more-than-90-days-ago/8463/17 "2021-06-19T14:40:40Z")

</div>

Hi,  
regarding this topi I would like understand if is possible with mautic create a segment with date\_condition: for example I would like create a segment in which dt\_last\_order \> (today)-5 . This is possible to do ?

Thanks in advance

---

<div class="post-metadata">

### Author: ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)
#### Post date: [June 20, 2021, 11:36am UTC](https://forum.mautic.org/t/how-can-i-create-a-segment-for-contacts-that-last-login-date-more-than-90-days-ago/8463/18 "2021-06-20T11:36:08Z")

</div>

yes this is possible by choosing the custom field you want and then greater than +5

---

<div class="post-metadata">

### Author: ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)
#### Post date: [June 21, 2021, 5:27am UTC](https://forum.mautic.org/t/how-can-i-create-a-segment-for-contacts-that-last-login-date-more-than-90-days-ago/8463/19 "2021-06-21T05:27:36Z")

</div>

Just one comment:  
During the last 5 days is:

dt\_last\_order **is greater** then -5 days

Older than 5 days:

dt\_last\_order **is less then** -5 days

---

<div class="post-metadata">

### Author: ![ospa123](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ospa123/32/3545_2.png) [@ospa123](https://forum.mautic.org/u/ospa123)
#### Post date: [June 23, 2021, 12:48pm UTC](https://forum.mautic.org/t/how-can-i-create-a-segment-for-contacts-that-last-login-date-more-than-90-days-ago/8463/20 "2021-06-23T12:48:29Z")

</div>

Hi,  
so the idea of “today” is directly setted up in the system, sorry but I’m really new on mautic.

Thanks
