{"Status":true,"Message":"","Response":{"post":{"postuid":"pspgp79c94","tenantuid":"d8b744fc-2e70-4089-bb80-dd1d08f6c7b2","projectuid":"239698c5-f7eb-4574-8cc8-c6568f08b3a0","title":"Complex Search Examples","slug":"article/pspgp79c94-common-searchs-used-for-segments","html":"\u003Cp\u003EBelow are examples of complex searches that are possible with DailyStory.\u003C/p\u003E\u003Ch3 id=\u0022working_with_dates\u0022\u003EWorking with dates\u003C/h3\u003E\u003Cp\u003EDates can be incredibly complex. For example, you may want to find contacts within a specific range of fixed dates such as between July 1, 2025 and July 31, 2025. Or you may want to find contacts within a sliding date range such as within the last 30 days.\u003C/p\u003E\u003Cp\u003EPlease see the \u003Ca href=\u0022/article/w9704u8cc1-advanced-contact-search-guide\u0022\u003EUsing Advanced Search article\u003C/a\u003E for details on how date syntax works.\u003C/p\u003E\u003Cp\u003EFor the purposes of the date examples, we\u0027ll use the standard field Date Created (\u003Ccode class=\u0022inline-code\u0022\u003EdateCreated\u003C/code\u003E). However, the examples below apply to any date field including those from an integration.\u003C/p\u003E\u003Cp\u003EBelow are examples of complex date searches:\u003C/p\u003E\u003Ch3 id=\u0022older_than_a_year_ago\u0022\u003EOlder than a year ago\u003C/h3\u003E\u003Cp\u003ETo find contacts with a field where the value is older than 1 year ago requires direct editing of the search syntax.\u003C/p\u003E\u003Cp\u003EWhen constructing the syntax for this search it is easiest to start with an existing search. For example, using one of the preset search options such as Past 1 Year. Running this search for Date Created generates the following syntax:\u003C/p\u003E\u003Cp\u003E\u003Ccode class=\u0022inline-code\u0022\u003E$dateCreatedFrom=Past-1-Year\u0026amp;dateCreatedTo=Today\u003C/code\u003E\u003C/p\u003E\u003Cp\u003EThis effectively states: return all contacts from 1 year ago from today\u0027s date up to today.\u003C/p\u003E\u003Cp\u003EWe want to change this to get all contacts older than 1 year ago.\u003C/p\u003E\u003Ch4 id=\u0022option_1__specify_a_from_and_a_to\u0022\u003EOption 1 - Specify a from and a to\u003C/h4\u003E\u003Cp\u003ETo bound the search to everyone created within the past 10 years older than a year ago:\u003C/p\u003E\u003Cp\u003E\u003Ccode class=\u0022inline-code\u0022\u003E$dateCreatedFrom=Past-11-Years\u0026amp;dateCreatedTo=Past-1-Year\u003C/code\u003E\u003C/p\u003E\u003Ch4 id=\u0022option_2__all_records_older_than_a_year_ago\u0022\u003EOption 2 - All records older than a year ago\u003C/h4\u003E\u003Cp\u003EWhile setting explicit ranges is usually best, the following is also valid and returns any record older than a year ago:\u003C/p\u003E\u003Cp\u003E\u003Ccode class=\u0022inline-code\u0022\u003E$dateCreatedTo=Past-1-Year\u003C/code\u003E\u003C/p\u003E\u003Cp\u003EIn the above example, the starting point of the search range (dateCreatedFrom) was removed.\u003C/p\u003E\u003Ch3 id=\u0022specific_ranges_of_dates\u0022\u003ESpecific ranges of dates\u003C/h3\u003E\u003Cp\u003EWhile the search tools provide options for manipulating dates, some customers have more advanced requirements. For example, when using the Shopify integration, you may want to build a segment that targets customers that purchased in the last 2 days.\u003C/p\u003E\u003Cp\u003EFor the purpose of our example, we\u0027ll use the Date Created contact field.\u003C/p\u003E\u003Ch4 id=\u0022contacts_created_in_last_2_days\u0022\u003EContacts created in last 2 days\u003C/h4\u003E\u003Cp\u003ETo accomplish this you will need to directly edit the search criteria:\u003C/p\u003E\u003Cp\u003E\u003Ccode\u003EdateCreatedFrom=yesterday\u0026amp;dateCreatedTo=today\u003C/code\u003E\u003C/p\u003E\u003Cp\u003EThis would return all customers that were created from yesterday until today.\u003C/p\u003E\u003Ch4 id=\u0022contacts_created_within_a_window_of_time\u0022\u003EContacts created within a window of time\u003C/h4\u003E\u003Cp\u003ESimilar to the examples above for finding contacts created over a year ago, you can also specify ranges. Some of these are built in as presents, such as \u0022Between 30 and 60 days ago\u0022, but you may want different ranges.\u003C/p\u003E\u003Cp\u003EFor example, people created within in the past year but older than 45 days:\u003C/p\u003E\u003Cp\u003E\u003Ccode\u003EdateCreatedFrom=past-1-year\u0026amp;dateCreatedToTo=past-45-days\u003C/code\u003E\u003C/p\u003E\u003Cp\u003EThis excludes anyone created in the past 45 days.\u003C/p\u003E","publish_status":0,"post_type":"Article","authoruid":"3dde8c16-763a-4a2b-ae0b-1d8c50c62e3d","author":{"authoruid":"3dde8c16-763a-4a2b-ae0b-1d8c50c62e3d"},"featured_image_updating":false,"meta_description":"Below are some tips on putting together common searches used to build segments. Birthdays by month DailyStory maintains and updates the annual birthday for your members (if you have provided their date of birth). A common request may be to build a segment for everyone whose birthday is in June (or any other month). However, this can be problematic since the birth year can vary. For example, if today is May 3rd, 2020 and two member\u0026#39;s birthdays are June 29, 1983 and June 7, 1974. DailyStor ...","display_toc":true,"has_workingcopy":false,"allow_indexing":true,"sort_order":4,"total_views":894,"date_published":"2024-08-23T14:16:30","date_updated":"2025-11-07T15:41:58.797","date_created":"2025-04-23T17:17:11.48"}}}