Search Results

Showing results 1 to 8 of 8
Search took 0.00 seconds.
Search: Posts Made By: cgyrob ; Forum: MS SQL and child forums
Forum: MS SQL 30 Days Ago
Replies: 11
Views: 850
Posted By cgyrob
Thanks for the response.

The cost on using functions on a where clause come when using the function on the column because it causes a table scan even on an indexed field. When the function is used...
Forum: MS SQL 31 Days Ago
Replies: 11
Views: 850
Posted By cgyrob
Why are you creating constants when you can just use the date functions in the where clause?



SELECT sum(Salesamount)
FROM Table
WHERE salesdate BETWEEN ...
Forum: MS SQL 31 Days Ago
Replies: 11
Views: 850
Posted By cgyrob
There are alot of ways to do this here are a couple examples.

Using Year() function

Select sum(Salesamount)
From Table
where Year(salesdate) = Year(@userInput)
Forum: MS SQL Oct 19th, 2009
Replies: 2
Views: 524
Posted By cgyrob
You can't use the alias in the boolean test plus you should use a having clause to test the count(*) and not the where clause.


Select title, count(*) As Cnt
From poss_titles
Group By title...
Forum: MS SQL Aug 29th, 2009
Replies: 2
Views: 483
Posted By cgyrob
Did you try using wild cards.


Select * from Table1
Where Name LIKE ('%' + @Name + '%')
Forum: MS SQL Jul 21st, 2009
Replies: 7
Solved: Query question
Views: 335
Posted By cgyrob
I don't see where you are getting the alias 'c'

Besides that i think you are making it more difficult then it has to be.



select *
from dbo.tblLevelOneApprover a,...
Forum: MS SQL Jul 16th, 2009
Replies: 4
Views: 391
Posted By cgyrob
Select Product From Table
Where Component in ('part1','part3')
Forum: MS SQL Jul 6th, 2009
Replies: 15
Views: 727
Posted By cgyrob
What you need to do is build the query for only the selected options within the code block. If you build a static select query with all the options then it will return nothing because no user will...
Showing results 1 to 8 of 8

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC