<?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>topic open SQL help please in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-sql-help-please/m-p/2036716#M418401</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a "Date range" as a selection screen criteria where user can enter single date or a range. For this range, I have to look in some table that has begda(begin date) and endda(enddate) and see that the range I entered on selection screen falls within begda and endda. I know it is easy for the single date (see my SQL below) but not sure how it could be done for a range! I heard this makes the logic complicated and any help you could provide would be great. Hope I gave all the details and please let me know if anyone needs more information. thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; select kostl syst begda endda from zhrccroll&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; into table i_staffccs&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; where syst = 'STAFF'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; and begda &amp;lt;= p_date&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; and endda &amp;gt;= p_date.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;--Mithun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Mar 2007 22:01:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-09T22:01:49Z</dc:date>
    <item>
      <title>open SQL help please</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-sql-help-please/m-p/2036716#M418401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a "Date range" as a selection screen criteria where user can enter single date or a range. For this range, I have to look in some table that has begda(begin date) and endda(enddate) and see that the range I entered on selection screen falls within begda and endda. I know it is easy for the single date (see my SQL below) but not sure how it could be done for a range! I heard this makes the logic complicated and any help you could provide would be great. Hope I gave all the details and please let me know if anyone needs more information. thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; select kostl syst begda endda from zhrccroll&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; into table i_staffccs&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; where syst = 'STAFF'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; and begda &amp;lt;= p_date&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; and endda &amp;gt;= p_date.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;--Mithun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 22:01:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-sql-help-please/m-p/2036716#M418401</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-09T22:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: open SQL help please</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-sql-help-please/m-p/2036717#M418402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As i understood that if user enter single data or range it should work....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can check in this way.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if p_date-high is not initial.&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;select kostl syst begda endda from zhrccroll&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;into table i_staffccs&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;where syst = 'STAFF'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;and begda =&amp;gt; p_date-low &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;and endda &amp;lt;= p_date-high .&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;select kostl syst begda endda from zhrccroll&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;into table i_staffccs&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;where syst = 'STAFF'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;and begda &amp;lt;= p_date&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;and endda &amp;gt;= p_date.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let me know if there is miscommunication...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 22:09:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-sql-help-please/m-p/2036717#M418402</guid>
      <dc:creator>former_member187255</dc:creator>
      <dc:date>2007-03-09T22:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: open SQL help please</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-sql-help-please/m-p/2036718#M418403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declare s_Date as select-option &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select kostl syst begda endda from zhrccroll&lt;/P&gt;&lt;P&gt; into table i_staffccs&lt;/P&gt;&lt;P&gt; where syst = 'STAFF'&lt;/P&gt;&lt;P&gt; and begda GE  s_date-low&lt;/P&gt;&lt;P&gt; and endda LE  s_date-high.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 22:09:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-sql-help-please/m-p/2036718#M418403</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-09T22:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: open SQL help please</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-sql-help-please/m-p/2036719#M418404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mithun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;not only it makes the logic complicated, but also it must be defined what the expectzed result will be: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the user has a select-option for the date, entering of exclusions, ranges , range exclusions and all kinds of comparison operators are allowed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think, to do it correct, you have to compare all dates between begda and endda against the range entered and check if any (or all?) dates are IN the selection range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First it has to be defined along this example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the users enters march 1st to march 10th.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does this match with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;begda january 1st and endda march 2nd or&lt;/P&gt;&lt;P&gt;begda march 2nd and endda april 1st or &lt;/P&gt;&lt;P&gt;begda  january 1st  and endda april 1st or &lt;/P&gt;&lt;P&gt;begda  march 2nd   and endda march 9th&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or all of them?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a process question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And how to act if a specific date is excluded?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or, if exclusion and/or compaisons are not allowed, you must restrict the entry posibilities - because: What is possible will be done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All is possible but first you must know what you want. This question is not so much  open SQL, more business requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 22:26:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-sql-help-please/m-p/2036719#M418404</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2007-03-09T22:26:59Z</dc:date>
    </item>
  </channel>
</rss>

