i want to count records found in database as per customer status
ex.
Code:
Custstatus Count Percentage (Count / total)
Active 5 0.5% how could i do this at crystal report
Not active 4 0.4% how could i do this at crystal report
Please help
Last edited by edgarbenilde; Aug 24th, 2009 at 03:03 AM.
You Don't Have to Rate Me. I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter :@avrail
010011000111010101110110001000000100110101111001001000000101000001100011
yes i'm done with with... my problem is to get the result of count / total
ex.
how many is active / total count of all entries (active, inactive, etc.)
and how many is inactive / total count of all entries (active, inactive, etc.)
and etc if there other entries specefied depend on the user entry
SET @Return = (SELECT COUNT(*) FROM dbo.<yourTableName>)
return @Return
END
Last edited by avrail; Aug 24th, 2009 at 03:50 AM.
Reason: there was something missing
You Don't Have to Rate Me. I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter :@avrail
010011000111010101110110001000000100110101111001001000000101000001100011
i found help codes in crystal report formula fields
like this
Code:
If {Customer.Region} In ["WA","ID","OR"] Then
"Northwest"
Else If {Customer.Region} In ["CA","TX","NV","AZ","NM"] Then
"Southwest"
Else If {Customer.Region} In ["AL","AR","LA","MS","TN","VA","WV","FL","NC","SC","GA"] Then
"Southeast"
Else If {Customer.Region} In ["CT","DC","DE","MD","NJ","ME","NH","NY","MA","PA","RI","VT"] Then
"Northeast"
Else If {Customer.Region} In ["UT","CO","WY","NE","MT"] Then
"Rocky Mountain"
Else
"Midwest"
in my case i want to count all entries which mymonth field value is 1.
can someone know to do it in crystal report formula fields?
why you insist to do this in your crystal report,
you can do it inside your database
i don't know crystal report well,
You Don't Have to Rate Me. I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter :@avrail
010011000111010101110110001000000100110101111001001000000101000001100011
Custstatus Count Percentage (Count / total)
Active 5 0.5% how could i do this at crystal report
Not active 4 0.4% how could i do this at crystal report
i want to this format
Code:
SELECT COUNT(Custstatus) FROM <YourTableName> GROUP BY Custstatus
based on your reply in post # 2 this is possible but lock of one row Value not found.
this is how to get the result but i don't know how..
Code:
count(cuscode) as mycountresult
count (*) as myallentries
mycountresult / myallentries
Group by Custstatus
thats it's but how to make a code for that...
it can be in Access querry or Formula field fo crystal report depends on what is easy to do..
You Don't Have to Rate Me. I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter :@avrail
010011000111010101110110001000000100110101111001001000000101000001100011
amm,
i didn't use access i use SQL Server
try to use your Query Designer to create 2 views
the first will be your one that you said you can done.
vb Code:
SELECT COUNT(Custstatus) FROM <YourTableName> GROUP BY Custstatus
and the other is for
vb Code:
SELECT COUNT(Custstatus) FROM <YourTableName>
with out any Group
and inside your crystal Report i believe that you can use the two Views.
and then you can do
CountActive/CountRows
You Don't Have to Rate Me. I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter :@avrail
010011000111010101110110001000000100110101111001001000000101000001100011
This is very easy to do in Crystal. Assume you have a sample report that is based on the Customer table in the Northwind database. To get a Count and Percentage of Customers by Country
1) Create a Group using the Country field.
2) Insert the CompanyName field in the Details section
3) Right click the CompanyName field and select Insert Summary
4) Select Count from the dropdown list.
5) Check the options "Insert Summary fields for all Groups" and "Insert Grand Total fields"
Two new fields should be created. One in the Group footer the other in the Report Footer
6) Copy and paste each summary field into the same section.
7) Right click on each pasted summary field and select Change Summary
8) Set the option "Show as a Percentage of"
9) Format the report as desired.
this is helpfull brucevde, but i don't Grand totals (92 and 100% summary.
i only have the bycountry with the count and percentage equevalent...
another issue i found i want to count how many of those records are belong to month of January, Febuary, March, April, May ........ up to December, in my database i have field called mymonth.. how could i do it?
this result would be look like this
Code:
January February March April May ...........
Total Records 8 6 5 8 10...........
the mymonth field data type is number so data inside it is (1 to 12 as equevalent to jan - dec.)
Last edited by edgarbenilde; Aug 25th, 2009 at 10:17 PM.
this is helpful it's but i didn't get a grand total of 92 and percentage 100%
another things how can i count how many of this records are belong to each month
in my database i have field called myMonth
this is going to be in this format
Code:
January February March April May ........... upto Dec
Total 8 11 7 9 11 92
the mymonth field data type is number so data inside it is (1 to 12 as equevalent to jan - dec.)
this code is the nearest code the result i want.. but this is general i want to put a filter on this, how could i put here if mymonth=1 then Count ({Customers.CompanyName}) and this will be my result for January, then count again mymonth=2 for february..
please help me here...
Code:
TotalCount = Count ({Customers.CompanyName})
Last edited by edgarbenilde; Aug 25th, 2009 at 10:20 PM.