on ‎2010 Feb 10 1:36 PM
This SQL expression works on MS SQL Server 2005 but not in the SQL Expression Editor of Crystal Reports.
Why? Any alternatives?
(
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
)Edited by: Valmont on Feb 10, 2010 2:36 PM
Request clarification before answering.
Create two different sql expressions like this
%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})*100HTH
Raghavendra.G
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 13 | |
| 8 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.