<?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: SQL calculation in expression editor CR 2008 in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/sql-calculation-in-expression-editor-cr-2008/qaa-p/6576041#M2396554</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah I did but was hoping I could I do it in a single query. Just to experiment with it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Feb 2010 07:22:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-02-11T07:22:11Z</dc:date>
    <item>
      <title>SQL calculation in expression editor CR 2008</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-calculation-in-expression-editor-cr-2008/qaq-p/6576039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This SQL expression works on MS SQL Server 2005 but not in the SQL Expression Editor of Crystal Reports.&lt;/P&gt;&lt;P&gt;Why? Any alternatives?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;(
declare @Trash Decimal
declare @Done Decimal

set @Trash =
(
  select count(*) from dbo.NL_NM_NUON 
  WHERE MAN_CAMPAIGNNAME = '9.304_Winback TM CM Jan 2010 - Bosch'  AND
  (
    fldFormalities In ('Persoon is verhuisd', 'Adres matcht niet met telefoonnummer',
	    'Weigering Gesprek', 'Dubbel in bestand', 'Persoon overleden',
	    'Beslisser tijdens actieperiode afwezig')
    OR
    fldEndresult = 'Is sinds kort klant bij NUON'
  )
)

set @Done =
(
  select count(*) from 
  NL_NM_NUON Where
  NL_NM_NUON.MAN_CAMPAIGNNAME = '9.304_Winback TM CM Jan 2010 - Bosch' AND
  STATUS IN ('U','F')
)

Select (@Trash / @Done) * 100
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Valmont on Feb 10, 2010 2:36 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2010 13:36:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-calculation-in-expression-editor-cr-2008/qaq-p/6576039</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-10T13:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: SQL calculation in expression editor CR 2008</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-calculation-in-expression-editor-cr-2008/qaa-p/6576040#M2396553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create two different sql expressions like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;%Expression1:

(
  select count(*) from dbo.NL_NM_NUON 
  WHERE MAN_CAMPAIGNNAME = '9.304_Winback TM CM Jan 2010 - Bosch'  AND
  (
    fldFormalities In ('Persoon is verhuisd', 'Adres matcht niet met telefoonnummer',
	    'Weigering Gesprek', 'Dubbel in bestand', 'Persoon overleden',
	    'Beslisser tijdens actieperiode afwezig')
    OR
    fldEndresult = 'Is sinds kort klant bij NUON'
  )

%Expression2:

(
  select count(*) from 
  NL_NM_NUON Where
  NL_NM_NUON.MAN_CAMPAIGNNAME = '9.304_Winback TM CM Jan 2010 - Bosch' AND
  STATUS IN ('U','F')
)


Now Create a formula like this

({%Expression1}/{%Expression2})*100&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Raghavendra.G&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2010 16:54:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-calculation-in-expression-editor-cr-2008/qaa-p/6576040#M2396553</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-10T16:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: SQL calculation in expression editor CR 2008</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-calculation-in-expression-editor-cr-2008/qaa-p/6576041#M2396554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah I did but was hoping I could I do it in a single query. Just to experiment with it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2010 07:22:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-calculation-in-expression-editor-cr-2008/qaa-p/6576041#M2396554</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-11T07:22:11Z</dc:date>
    </item>
  </channel>
</rss>

