Body: <p>I have a two-pronged question: I want to search Contacts whose first contribution is within a date range, so I have grouped by Contact ID and included Contributions.</p>
  <p>Min of Contribution Date does actually give the first date in the output, but when I try to use it as a Having condition, I am getting only a text field rather than a date field, and can't make sense of what comparison I am doing.</p>
  <p>The second issue (down the line) is that really I'd want to use a relative date, ie first contribution date is within so many months of today.</p>
  <p>The latter I realise may not be possible, but I feel that the first ought to work.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-09-25T22:47:54.200Z
Comments.Text: What version of CiviCRM is this? I feel like I read a bug report about this recently.
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-09-26T15:03:41.850Z
Comments.Text: Thanks; just catching up.  But the version is 5.65.2 on WordPress.
Comments.UserDisplayName: Michael FORWARD
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-09-26T15:56:11.427Z
Comments.Text: Does the problem occur on https://wpmaster.demo.civicrm.org?  If not, you can resolve it with an upgrade.  Though you should upgrade anyway, that version of CiviCRM is insecure!
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-09-27T14:08:38.087Z
Comments.Text: I am just going out but I will try asap.  Thank you
Comments.UserDisplayName: Michael FORWARD
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-09-30T09:42:42.523Z
Comments.Text: I can't seem to do anything in the sandbox at all. It is displaying just as text with no menu.
Comments.UserDisplayName: Michael FORWARD
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-10-01T14:52:08.463Z
Comments.Text: How can SearchKit be accessed in the sandbox? I see only a very limited range of functions.
Comments.UserDisplayName: Michael FORWARD
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-10-01T18:51:10.167Z
Comments.Text: yep that demo site seems a bit borked - you can try https://dmaster.demo.civicrm.org/ as SK features should be independent of CMS
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-10-09T10:52:47.380Z
Comments.Text: This took a bit of working out, but I got there in the end.  Unforch, the having condition for min of contribution date still gives a text field. I don't know what format it's expecting, but If I put greater than anything I get all dates and if I put less than anything I get no dates.
Comments.UserDisplayName: Michael FORWARD
Tags: <searchkit>
Title: Earliest Date as "Having" Condition
ThreadText: # Earliest Date as "Having" Condition
  
  (Asked by: username_0 on 2024-09-25)
  
  I have a two-pronged question: I want to search Contacts whose first contribution is within a date range, so I have grouped by Contact ID and included Contributions.
  
  Min of Contribution Date does actually give the first date in the output, but when I try to use it as a Having condition, I am getting only a text field rather than a date field, and can't make sense of what comparison I am doing.
  
  The second issue (down the line) is that really I'd want to use a relative date, ie first contribution date is within so many months of today.
  
  The latter I realise may not be possible, but I feel that the first ought to work.
  
  **Tags:** searchkit
  
  > **Comments:**
  > **username_1**: What version of CiviCRM is this? I feel like I read a bug report about this recently.  
  > **username_0**: Thanks; just catching up.  But the version is 5.65.2 on WordPress.  
  > **username_1**: Does the problem occur on https://wpmaster.demo.civicrm.org?  If not, you can resolve it with an upgrade.  Though you should upgrade anyway, that version of CiviCRM is insecure!  
  > **username_0**: I am just going out but I will try asap.  Thank you  
  > **username_0**: I can't seem to do anything in the sandbox at all. It is displaying just as text with no menu.  
  > **username_0**: How can SearchKit be accessed in the sandbox? I see only a very limited range of functions.  
  > **username_2**: yep that demo site seems a bit borked - you can try https://dmaster.demo.civicrm.org/ as SK features should be independent of CMS  
  > **username_0**: This took a bit of working out, but I got there in the end.  Unforch, the having condition for min of contribution date still gives a text field. I don't know what format it's expecting, but If I put greater than anything I get all dates and if I put less than anything I get no dates.  
  
  ---
  
  ## 0 answers
  
  