Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help in SQl query to enter n Command in Crystal XI 1

Status
Not open for further replies.

mintman

IS-IT--Management
Mar 5, 2007
66
US
Hello friends,
SELECT
Count("PHPICK00"."PHPCTL") as CountPHCTL
FROM "IASP1"."WMDIBSF05"."PHPICK00" "PHPICK00"..this works fine in Command.
But I want to direclty do Count("PHPICK00"."PHPCTL") for PHPSTF = 00 or 10.
I like to know how we write for condition. I dont want to use where becaus I want to use PHPSTF = 00 or 10 only ("PHPICK00"."PHPCTL") and I have count another field for different condition.
Thanks for the help.
Reed.
 
You want to count just some of the records that should be appearing on your report? The normal solution is a Running total. (If you're not already familiar with Crystal totals, the basics are explained at FAQ767-6524.)

Also take a look at Crosstabs, they're bound to be useful later on even if they don't solve this problem.

It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Hello, I am used to runnig total and other formula, I was wondering how to give the sql syntax for this type of selection,
I have to count a field ASD00 where(SDF00=10), I want to know how to write this sql in COMMAND promt in Database expert in CRXI. I was thinking like Count(ASD00)(Case:SDF00=10) something liek that. Any sugeestions please.
Thank You so much.
Reed
 
The case statement synatx will be something like this :-

Code:
Sum((CASE WHEN "Table"."SDF00" = 10 then
    1
ELSE
    0
END)) AS CountASD00

HTH

Gary Parker
MIS Data Analyst
Manchester, England
 
Thank you Gary, will give a shot on this.
Reed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top