Viewing 15 posts - 3,796 through 3,810 (of 4,085 total)
shank-130731 (1/15/2011)
If @ID is provided, I want the WHERE clause to only reflect ID=@CaseID. If not provided then just RMARequestedDate > (GetDate()- @d).
WHERE CASE @ID
WHEN...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
January 17, 2011 at 9:40 am
Doesn't the following give you want you want?
ORDER BY Sort, Type
If not, something similar should give you the desired results.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
January 15, 2011 at 11:45 am
David's approach will work if you're only reporting on a single day, but immediately runs into problems when reporting on multiple days. A much better approach when you're reporting...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
January 14, 2011 at 8:35 am
The problem is that your SET expression is returning text, not a column name. If you want to return a column you should rewrite your query as follows:
SELECT top...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
January 13, 2011 at 2:37 pm
An update trigger will always fire when the table is updated. That is the nature of triggers.
If you want to control the behavior of the trigger based on userid,...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
January 13, 2011 at 8:11 am
There is a much simpler way using COALESCE.
SELECT *
FROM #M_Vendor
WHERE Coalesce(@imported, DailySettlementYN, -1) = Coalesce(DailySettlementYN, -1)
The -1 forces an implicit conversion of the bit data.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 27, 2010 at 1:41 pm
nikshepmehra (12/7/2010)
But the query gave an error as
"The xml data type cannot be...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 9, 2010 at 2:20 pm
Craig Farrell (12/7/2010)
Run this sample, it'll show you what I mean. GO cannot be part of the proc.
I know what YOU mean. What I mean is
CREATE PROC TEST_THIS
AS
DECLARE...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 8, 2010 at 3:04 pm
Craig Farrell (12/7/2010)
drew.allen (12/7/2010)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 7, 2010 at 2:09 pm
I was trying to do the same thing and ran into the same problem. The cause was a GO statement that I included in my dynamic SQL. The...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 7, 2010 at 11:32 am
scott.pletcher (11/30/2010)
I've never had any issue...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 30, 2010 at 9:10 am
Information_Schema.Routines will only return the first 4000 characters of your stored procedure. If there is any chance at all that your stored proc is longer than that, you'll probably...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 29, 2010 at 6:51 am
Is this what you are looking for?
select vendaddr.name
from vendaddr
inner join vendor
on IsNull(vendor.vend_num, vendor.vend_remit) = vendaddr.vend_num
It will use the vendor_num if it is not null and will use the vend_remit otherwise.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 23, 2010 at 11:48 am
Given the data points for the date, it looks like the base date is 1899-12-30. The time is harder to determine, because you haven't given us enough data points....
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 17, 2010 at 3:14 pm
I also notice that you are missing some indices that might help. For example, Oilchange_Notes is missing an index on vehicle_id. Since that is used in your join,...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 3, 2010 at 3:18 pm
Viewing 15 posts - 3,796 through 3,810 (of 4,085 total)