<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Using DATEADD and QTR functions in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/using-dateadd-and-qtr-functions/qaa-p/11657391#M4355832</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your help. With a few tweaks everything worked perfectly!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Apr 2016 13:43:58 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2016-04-20T13:43:58Z</dc:date>
    <item>
      <title>Using DATEADD and QTR functions</title>
      <link>https://community.sap.com/t5/technology-q-a/using-dateadd-and-qtr-functions/qaq-p/11657385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a report I'm trying to write that needs a specific logic. This is regarding when an employee is eligible for 401K. &lt;/P&gt;&lt;P&gt;The logic is : &lt;SPAN style="text-decoration: underline;"&gt;Eligible the 1st of the month after your 91st day of employment.&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other logic is that the employee enters Cash Profit Sharing &lt;SPAN style="text-decoration: underline;"&gt;the first of the month of the next quarter on their 91st day.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{CRT_EMP_START_DATE.EMPLOYMENT_DATE}&lt;SPAN style="text-decoration: underline;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having a bit of an issue understanding how to use the functions crystal reports provides to achieve what the date would be. I know how to use formulas and implement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is always greatly appreciated.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ajax&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2016 16:01:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/using-dateadd-and-qtr-functions/qaq-p/11657385</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-04-19T16:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using DATEADD and QTR functions</title>
      <link>https://community.sap.com/t5/technology-q-a/using-dateadd-and-qtr-functions/qaa-p/11657386#M4355827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I might do something like this to get the dates:&amp;nbsp; (I like to break it down into parts...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;401K:&lt;/P&gt;&lt;P&gt;DateVar day91 := DateAdd('d', 91, &lt;SPAN style="color: #333333; font-size: 12px; background-color: #f8f8f8;"&gt;{CRT_EMP_START_DATE.EMPLOYMENT_DATE});&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #f8f8f8;"&gt;if Day(day91) &amp;gt; 1 then day91 := DateAdd('m', 91, day91);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #f8f8f8;"&gt;Date(Year(day91), Month(day91), 1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #f8f8f8;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #f8f8f8;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #f8f8f8;"&gt;Profit Sharing:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #f8f8f8;"&gt;DateVar qtrDate := DateAdd(q, 1, DateAdd('d', 91, &lt;SPAN style="color: #333333; font-size: 12px; background-color: #f8f8f8;"&gt;{CRT_EMP_START_DATE.EMPLOYMENT_DATE}));&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #f8f8f8;"&gt;NumberVar qtr := DatePart('q', qtrDate);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #f8f8f8;"&gt;Choose(qtr, Date(year(qtrDate), 1, 1), Date(year(qtrDate), 4,1), Date(year(qtrDate), 7, 1), Date(year(qtrDate), 10, 1))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #f8f8f8;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #f8f8f8;"&gt;This assumes that you're on calendar quarters that start on Jan 1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #f8f8f8;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #f8f8f8;"&gt;-Dell&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #f8f8f8;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2016 16:16:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/using-dateadd-and-qtr-functions/qaa-p/11657386#M4355827</guid>
      <dc:creator>DellSC</dc:creator>
      <dc:date>2016-04-19T16:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Using DATEADD and QTR functions</title>
      <link>https://community.sap.com/t5/technology-q-a/using-dateadd-and-qtr-functions/qaa-p/11657387#M4355828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the help. I like to break it into parts as well. I somewhat know what you're doing and am coming upon a couple of errors. The first one is in the 401K where it says: &lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/933632" width="450" /&gt;&lt;/P&gt;&lt;P&gt;And this one for Profit Sharing:&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/933633" height="91" width="500" /&gt;&lt;/P&gt;&lt;P&gt;I understand what the errors are telling me I'm just not sure why. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2016 17:15:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/using-dateadd-and-qtr-functions/qaa-p/11657387#M4355828</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-04-19T17:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using DATEADD and QTR functions</title>
      <link>https://community.sap.com/t5/technology-q-a/using-dateadd-and-qtr-functions/qaa-p/11657388#M4355829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is {CRT_EMP_START_DATE.EMPLOYMENT_DATE} a date field or a string field?&amp;nbsp; If it's a string, you might have to use this when you include the field in the formula:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date(&lt;SPAN style="font-size: 13.3333px;"&gt;{CRT_EMP_START_DATE.EMPLOYMENT_DATE})&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Also, instead of using &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp; DateAdd('d', 91', &lt;SPAN style="font-size: 13.3333px;"&gt;{CRT_EMP_START_DATE.EMPLOYMENT_DATE}) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;you could try&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;{CRT_EMP_START_DATE.EMPLOYMENT_DATE} + 91 and see whether that help.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'll need to do this in both formulas. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To debug, comment out all but the first line in each formula by placing // at the beginning of each line.&amp;nbsp; Check to see that you're getting an actual date value from that first line before adding back in the next lines. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Dell&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2016 18:40:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/using-dateadd-and-qtr-functions/qaa-p/11657388#M4355829</guid>
      <dc:creator>DellSC</dc:creator>
      <dc:date>2016-04-19T18:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using DATEADD and QTR functions</title>
      <link>https://community.sap.com/t5/technology-q-a/using-dateadd-and-qtr-functions/qaa-p/11657389#M4355830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;{CRT_EMP_START_DATE.EMPLOYMENT_DATE} is a DateTime field. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that Date({CRT_EMP_START_DATE.EMPLOYMENT_DATE} works then when I comment out:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//If Day(day91) &amp;gt; 1 then day91 := DateAdd('m', 91, day91) &lt;/P&gt;&lt;P&gt;it gives me no errors. If I don't comment out &lt;/P&gt;&lt;P&gt;if Day(day91) &amp;gt; 1 then day91 := DateAdd('m', 91, day91)&lt;/P&gt;&lt;P&gt;then I get the same error. "A Date is required here" but on line: &lt;/P&gt;&lt;P&gt;DateAdd('m', 91, day91)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other ideas for debugging or what this might be?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2016 20:18:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/using-dateadd-and-qtr-functions/qaa-p/11657389#M4355830</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-04-19T20:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: Using DATEADD and QTR functions</title>
      <link>https://community.sap.com/t5/technology-q-a/using-dateadd-and-qtr-functions/qaa-p/11657390#M4355831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That should actually be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DateAdd('m', 1, day91);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry!&amp;nbsp; My mistake in my sample.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could also try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DateAdd('m', 1, Date(day91));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Dell&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2016 21:19:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/using-dateadd-and-qtr-functions/qaa-p/11657390#M4355831</guid>
      <dc:creator>DellSC</dc:creator>
      <dc:date>2016-04-19T21:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using DATEADD and QTR functions</title>
      <link>https://community.sap.com/t5/technology-q-a/using-dateadd-and-qtr-functions/qaa-p/11657391#M4355832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your help. With a few tweaks everything worked perfectly!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2016 13:43:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/using-dateadd-and-qtr-functions/qaa-p/11657391#M4355832</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-04-20T13:43:58Z</dc:date>
    </item>
  </channel>
</rss>

