Click here to Skip to main content
15,884,986 members
Home / Discussions / C#
   

C#

 
GeneralRe: Just for fun - how slow are exceptions? Pin
Luc Pattyn22-Apr-09 6:42
sitebuilderLuc Pattyn22-Apr-09 6:42 
GeneralRe: Just for fun - how slow are exceptions? Pin
Rob Philpott22-Apr-09 6:51
Rob Philpott22-Apr-09 6:51 
QuestionSQL SCRIPT Pin
kibromg22-Apr-09 4:43
kibromg22-Apr-09 4:43 
AnswerRe: SQL SCRIPT Pin
Henry Minute22-Apr-09 5:13
Henry Minute22-Apr-09 5:13 
GeneralRe: SQL SCRIPT Pin
kibromg22-Apr-09 5:23
kibromg22-Apr-09 5:23 
GeneralRe: SQL SCRIPT Pin
Dave Kreskowiak22-Apr-09 6:49
mveDave Kreskowiak22-Apr-09 6:49 
GeneralRe: SQL SCRIPT Pin
Henry Minute22-Apr-09 7:49
Henry Minute22-Apr-09 7:49 
AnswerRe: SQL SCRIPT Pin
PauloCastilho22-Apr-09 8:20
PauloCastilho22-Apr-09 8:20 
It´s very hard to rewrite a SQL query that I didn´t know the schema and relationships. Anyway, I made some changes.
kibromg wrote:
select count(distinct(CR_Cli))

Verify if the column has an index.

kibromg wrote:
datename(month,cr_callstart)='April'

Do not use much functions on where clause. Simplify... use "month(CR.callstart) = 4".

kibromg wrote:
and Cr_cli not in (select Cr_cli from Callrecords where cr_callstart<'2009-03-31')

If Cr_Cli "not in" where cr_callstart < '2009-03-31 then Cr_Cli "is in" where cr_callstart > '2009-03-30'. More than that, you are already referencing Callrecords in inner join, so you don´t need to create a subselect. On where clause, use this condition: "CR.callstart > '2009-03-30'".

kibromg wrote:
group by SO_name desc

On group by you have the column SO_name. Does this column have an index?! If not, you must consider creating one.

Try the code below, maybe it helps.
<br />
select count(distinct(CR.Cli))<br />
     , SO.name<br />
  from Callrecords CR<br />
 inner<br />
  join StudioOperators SO<br />
    on CR.StudioOperatorID = SO.ID<br />
 where month(CR.callstart) = 4<br />
   and CR.callstart > '2009-03-30'<br />
 group by SO.name desc<br />

QuestionParsing incoming DateTime in C# WebService myself? Pin
Thomas ST22-Apr-09 4:39
Thomas ST22-Apr-09 4:39 
AnswerRe: Parsing incoming DateTime in C# WebService myself? Pin
student_rhr22-Apr-09 7:57
student_rhr22-Apr-09 7:57 
QuestionHow to make a column of listview control invisible Pin
NarVish22-Apr-09 4:30
NarVish22-Apr-09 4:30 
AnswerRe: How to make a column of listview control invisible Pin
Eddy Vluggen22-Apr-09 4:55
professionalEddy Vluggen22-Apr-09 4:55 
Questionhelp Pin
benson.misi22-Apr-09 4:28
benson.misi22-Apr-09 4:28 
AnswerRe: help Pin
musefan22-Apr-09 4:35
musefan22-Apr-09 4:35 
AnswerRe: help Pin
SeMartens22-Apr-09 4:39
SeMartens22-Apr-09 4:39 
AnswerRe: help Pin
CPallini22-Apr-09 4:41
mveCPallini22-Apr-09 4:41 
AnswerRe: help Pin
Thomas ST22-Apr-09 4:45
Thomas ST22-Apr-09 4:45 
QuestionObject "type not expected" when using serialization in web services Pin
BASONJS22-Apr-09 4:03
BASONJS22-Apr-09 4:03 
AnswerRe: Object "type not expected" when using serialization in web services Pin
Thomas ST22-Apr-09 4:59
Thomas ST22-Apr-09 4:59 
GeneralRe: Object "type not expected" when using serialization in web services Pin
BASONJS22-Apr-09 5:14
BASONJS22-Apr-09 5:14 
GeneralRe: Object "type not expected" when using serialization in web services Pin
Thomas ST22-Apr-09 20:57
Thomas ST22-Apr-09 20:57 
GeneralRe: Object "type not expected" when using serialization in web services Pin
BASONJS22-Apr-09 23:04
BASONJS22-Apr-09 23:04 
GeneralRe: Object "type not expected" when using serialization in web services Pin
BASONJS23-Apr-09 5:29
BASONJS23-Apr-09 5:29 
Questionproblem with keypress function Pin
MehmetKocc22-Apr-09 3:57
MehmetKocc22-Apr-09 3:57 
AnswerRe: problem with keypress function Pin
musefan22-Apr-09 4:02
musefan22-Apr-09 4:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.