Viewing 15 posts - 4,411 through 4,425 (of 5,504 total)
Maybe it's the wrong function you're using:
AVG(NULLIF(F.WinningBid,0)/NULLIF(F.AuctionSellerReserve, 0))
Straight from BOL (BooksOnLine):
NULLIF returns the first expression if the two expressions are not equivalent. If the expressions are equivalent, NULLIF returns a...
January 27, 2010 at 11:15 am
You need to link the CTE back to your original table. Since I don't have any other field unique field I used the addr field. I expect you have an...
January 27, 2010 at 10:53 am
If you compare two character fields and you run into the collation conflict you can change the collation inside the query:
SELECT [object_id]
FROM report_objects
WHERE report_id = @report_id
AND...
January 27, 2010 at 10:16 am
How about the following code?
It is based on the assumption that, if there is another blank character after the one that follows the direction separator [dpos], then dpos is a...
January 27, 2010 at 9:55 am
Going back to your very first post:
anshu84onnet (1/26/2010)
January 27, 2010 at 9:26 am
RHaverty 8478 (1/27/2010)
Declare Amt Decimal(10,2)
Select Amt = dbo.ConvertNullToZero(DbAmtVal)
...
January 27, 2010 at 9:16 am
If you want all the other columns to be in there as well, how would your expected output look like?
Either you have one row per firstName then you'd have to...
January 27, 2010 at 6:55 am
@ Lynn:
I'd experct the second query to be SELECT * instead of another SELECT 8...
January 27, 2010 at 6:25 am
Glad it finally worked out! 🙂
Did you notice how fast you had a tested solution once you provided ready to use data? 😉
I see you use the varchar(8000) instead of...
January 26, 2010 at 11:11 am
Without table definition and sample data provided as per the first link in my signature we can't really help you.
When I asked for an example I was talking about sample...
January 26, 2010 at 9:23 am
Now that we have ready to use data it becomes really easy:
You have to use a dynamic SELECT statement using the ISNULL function inside your dynamic sql statement:
...
January 26, 2010 at 9:14 am
Please provide all related table definition together with sample data and expected result in a ready to use format.
The query you provided won't run due to missing tables and columns.
January 25, 2010 at 4:35 pm
I don't think there will be a "best practice" answer...
It's more like one for the "it depends" category... But I might be wrong.
I, personally would use the first option since...
January 25, 2010 at 1:12 pm
Would you mind sharing an example so we have something to play with?
January 25, 2010 at 12:16 pm
You have to apply the ISNULL() function to your outer SELECT statement. That means you cannot use a SELECT *.
Unfortunately, your sample data and your query don't match (columns [Columns]...
January 25, 2010 at 12:09 pm
Viewing 15 posts - 4,411 through 4,425 (of 5,504 total)