Comment by Usman Butt on Fatherjack's answer
+1 from me as well which makes +2. Let us hope others will make it +100 ;-)
View ArticleAnswer by Phil Factor
Well I wouldn't design it this way, but if I've understood what you want then this might work... SELECT COALESCE(SUBSTRING(Cast(trandate as CHAR(8)),7,2),'Total') AS [Day],...
View ArticleComment by ritu
i just want to clear my objective that the query given by me is just giving count of employees who are agent as well as they've procured business during the month.and i want solution which gives count...
View ArticleComment by Phil Factor
I'm a bit baffled. My query gives the total number per day, and per month of employees who are agents who procure business. It does this in a single query. It lists the month and the day. You say (in a...
View ArticleComment by ritu
Example for my question: Firstly Execute query given below: SELECT COUNT(emp_no)as 'Active_Agents_Of_Month' FROM employees1 WHERE emp_no IN (SELECT Mnth FROM (SELECT CASE WHEN trandate = '20120831'...
View ArticleAnswer by Fatherjack
If this is a new system then I would suggest fixing the issues with datatypes first. Using char(8) for data that is an INTEGER and Numeric for data that is a DATE is only going to give you headaches...
View Article
More Pages to Explore .....