16,020,984 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by MohammedSabry (Top 23 by date)
MohammedSabry
1-Mar-11 19:07pm
View
it`s works but it didn`t give the right values !!
MohammedSabry
14-Feb-11 9:08am
View
it didn`t
MohammedSabry
13-Feb-11 21:10pm
View
TABLE DISTRICTS :
Districts.id, Districts.name
TABLE : Interview_Schedule
Interview_Schedule.app_id, Interview_Schedule.interview_district, Interview_Schedule.interview_result
RELATION:
Districts INNER JOIN
Interview_Schedule ON Districts.id = Interview_Schedule.interview_district
Interview_Schedule.interview_result value can be 0 or 1 or NULL
i want the output from this column to be three columns :
1st : count of (0)
2nd : count of (1)
3ed : count of NULL
MohammedSabry
13-Feb-11 20:58pm
View
can you write it ?
MohammedSabry
13-Feb-11 20:50pm
View
so if you please what`s the error in the first statement ??
MohammedSabry
13-Feb-11 20:26pm
View
Deleted
NOW THIS !!!
CREATE PROCEDURE dbo.StoredProcedure7
AS
(SELECT dbo.Districts.name,count(distinct(dbo.Interview_Schedule.app_id)) AS nom,
CASE dbo.Interview_Schedule.interview_result
WHEN NULL THEN 'no value'
WHEN 0 THEN 'zero'
WHEN 1 THEN 'one'
END AS thevalue
FROM Districts INNER JOIN
Interview_Schedule ON Districts.id = Interview_Schedule.interview_district
WHERE dbo.Interview_Schedule.work_flow_id=1
group by dbo.Districts.name , count(distinct(dbo.Interview_Schedule.app_id)) )AS datatable
PIVOT
( COUNT(thevalue)
FOR thevalue IN ([no value],[zero],[one])) as piv
ERROR::
Msg 156, Level 15, State 1, Procedure StoredProcedure7, Line 13
Incorrect syntax near the keyword 'AS'.
MohammedSabry
13-Feb-11 20:23pm
View
Deleted
NOW THIS !!!
CREATE PROCEDURE dbo.StoredProcedure7
AS
(SELECT dbo.Districts.name,count(distinct(dbo.Interview_Schedule.app_id)) AS nom,
CASE dbo.Interview_Schedule.interview_result
WHEN NULL THEN 'no value'
WHEN 0 THEN 'zero'
WHEN 1 THEN 'one'
END AS thevalue
FROM Districts INNER JOIN
Interview_Schedule ON Districts.id = Interview_Schedule.interview_district
WHERE dbo.Interview_Schedule.work_flow_id=1
group by dbo.Districts.name , count(distinct(dbo.Interview_Schedule.app_id)) )AS datatable
PIVOT
( COUNT(thevalue)
FOR thevalue IN ([no value],[zero],[one])) as piv
ERROR::
Msg 156, Level 15, State 1, Procedure StoredProcedure7, Line 13
Incorrect syntax near the keyword 'AS'.
MohammedSabry
13-Feb-11 19:21pm
View
it gives me error
{Msg 325, Level 15, State 1, Procedure StoredProcedure7, Line 11
Incorrect syntax near 'PIVOT'. You may need to set the compatibility level of the current database to a higher value to enable this feature. See help for the stored procedure sp_dbcmptlevel.
}
MohammedSabry
12-Feb-11 11:25am
View
it works thanks
MohammedSabry
12-Feb-11 11:02am
View
The multi-part identeifier "Interview_Schedule.work_flow_id" could not be bound
MohammedSabry
12-Feb-11 10:14am
View
I did put it please check it and tell me whats wrong ,its give me error
{Error in list of function arguments: 'FROM' not recognized.
Unable to parse query text.}
MohammedSabry
12-Feb-11 10:03am
View
Deleted
<pre>SELECT Districts.name, COUNT(DISTINCT Interview_Schedule.app_id) AS [APP] , (COUNT(Interview_Schedule.value)FROM Districts INNER JOIN
Interview_Schedule ON Districts.id = Interview_Schedule.interview_district WHERE Interview_Schedule.value=1)AS [ONES],
(COUNT(Interview_Schedule.value)FROM Districts INNER JOIN
Interview_Schedule ON Districts.id = Interview_Schedule.interview_district WHERE Interview_Schedule.value=0)AS [ZEROS],
(COUNT(Interview_Schedule.value)FROM Districts INNER JOIN
Interview_Schedule ON Districts.id = Interview_Schedule.interview_district WHERE Interview_Schedule.value IS NULL)AS [NULLS]
FROM Districts INNER JOIN
Interview_Schedule ON Districts.id = Interview_Schedule.interview_district
WHERE (Interview_Schedule.work_flow_id = 2)
GROUP BY Districts.name</pre>
MohammedSabry
12-Feb-11 9:49am
View
Deleted
SELECT Districts.name, COUNT(DISTINCT Interview_Schedule.app_id) AS [APP] , COUNT(Interview_Schedule.value) (((when it`s 0 and count when it`s 1 and count when it`s NULL))))
FROM Districts INNER JOIN
Interview_Schedule ON Districts.id = Interview_Schedule.interview_district
WHERE (Interview_Schedule.work_flow_id = 2)
GROUP BY Districts.name
MohammedSabry
12-Feb-11 9:43am
View
Deleted
<pre lang="sql">SELECT Districts.name, COUNT(DISTINCT Interview_Schedule.app_id) AS [????? ?? ???????]
FROM Districts INNER JOIN
Interview_Schedule ON Districts.id = Interview_Schedule.interview_district
WHERE (Interview_Schedule.work_flow_id = 2)
GROUP BY Districts.name</pre>
MohammedSabry
12-Feb-11 9:20am
View
it`s not working
MohammedSabry
12-Feb-11 7:59am
View
Deleted
what if i want to count the distinct values ??
MohammedSabry
12-Feb-11 6:09am
View
the column (value) may contain (0) or (1) or (NULL)
I want the output to be three columns
column 1 --> COUNT (value) AS ZEROS when it`s = 0
column 2 --> COUNT (value) AS ONES when it`s = 1
column 3 --> COUNT (value) AS NULLS when it`s = NULL
got it ??
MohammedSabry
12-Feb-11 5:46am
View
i dont want count of all i want my output of column ( value ) = 3 column each column contain count of each value ( count of zeros , count of ones , count of nulls )
MohammedSabry
22-Jan-11 9:40am
View
thanks
MohammedSabry
21-Jan-11 11:02am
View
thanks for your help
MohammedSabry
21-Jan-11 10:06am
View
ok if i add folder in my solution it`s name is (PIC) and then i add (pro.png) in this folder
whats the full path will be ??
MohammedSabry
21-Jan-11 8:10am
View
it`s windows application , i`m sorry
MohammedSabry
15-Jan-11 5:48am
View
* sorry thatraja if the db-computer ip=0123456789 what tha Connection String will be ... ?
* what is DBMSSOCN mean ?
* wont i need any SQL tool to insatall on Client-Computer ?
and thank you very very much for help i`ll tell you if it work ... thx
Show More