<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Computing date difference in SQL query</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121522967" />
  <subtitle>Computing date difference in SQL query</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121522967</id>
  <updated>2026-08-07T18:39:47Z</updated>
  <dc:date>2026-08-07T18:39:47Z</dc:date>
  <entry>
    <title>Computing date difference in SQL query</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121522966" />
    <author>
      <name>Sarthak Jain</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121522966</id>
    <updated>2022-09-26T15:49:04Z</updated>
    <published>2022-09-24T12:10:59Z</published>
    <summary type="html">&lt;p&gt;I need to ascertain the date difference using a flowing query but it
  does not work. Please Guide. &lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;SELECT ID, VoucherNo, DateRec, ProductID, Description, ClaimantCo, ClaimantName, City, Phone, DateReturn, ReqJob, WSIns, Remarks, Status, Part1, Part2, Part3, Part4, OtherWSCharges, FDCharges, P1Charges, P2Charges, P3Charges, P4Charges, DateJobBegun, DateJobDone, WSRemarks, TotChargesFromWS, DeliveryStatus, DateDelivered 
FROM tblClaims 
WHERE DateDiff(dd, DateReturn, GETDATE()) =3&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Before trying this I have also gone through some resources &lt;a
  href="https://www.scaler.com/topics/date-difference-in-sql/"&gt;here&lt;/a&gt;
  but was not sure what I am doing is correct is not, My motivation is
  to get records for which three days are passed on to DateRetun,
  contrasting with the present date.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Sarthak Jain</dc:creator>
    <dc:date>2022-09-24T12:10:59Z</dc:date>
  </entry>
</feed>
