Viewing 15 posts - 811 through 825 (of 1,183 total)
Why not use ISNULL instead of NULLIF.
i.e.
CREATE PROCEDURE Test
@employee int = NULL
AS
SELECT * FROM Employees
WHERE EmployeeID = @Employee or ISNULL(@Employee, '') = ''
October 30, 2007 at 10:15 am
Using Koji's example with CTEs and converting it to be 2000 compatible.
This works, but is messy.
CREATE TABLE #tmp (EmpID INT , LocationID INT , Amount NUMERIC(9,2))
INSERT #tmp
...
October 30, 2007 at 10:12 am
Because the '' is being converted to a bit for the comparison in the NULLIF. When you convert a '' to BIT it returns 0, therefore NULLIF returns a NULL...
October 30, 2007 at 9:25 am
The first loads the initial value into the cursor, this then allows you to check for the existence of a value and loop while one exists. If you didn't initially...
October 30, 2007 at 7:22 am
Jeff's right, we're all willing to help someone who's stuck. Unless you show that you've tried, I'm not gonna make it easy for ya. 😀
Show what you've tried for each...
October 28, 2007 at 8:40 pm
you can use
CURRENT_TIMESTAMP
- OR
GETDATE()
October 26, 2007 at 10:52 am
Because I'm guessing your issue is here.... [ & 'Week1' & ]
SELECT
[Item] = CASE WHEN [row] IS NULL THEN...
October 26, 2007 at 9:12 am
Sorry, I reformatted this so that I could follow it, but what does the following code return in the col field?
Sample results please?
SELECT ...
October 26, 2007 at 8:34 am
Matt Miller (10/26/2007)
you CAN use a case statement in your where clause, but not in the way you're looking at it.
Matt, I wasn't saying that you COULDN'T use a...
October 26, 2007 at 7:39 am
Well, in that CASE. No pun intended.... Instead of using a CASE statement, wrap your logic in parentheses.
WHERE
(jomast.ftype = 'I' AND...
October 26, 2007 at 7:28 am
Your logic seems flawed? You are testing each condition with the same three fields having the same values, and then you compare the fourth to the variable's value ..
WHERE
...
October 26, 2007 at 7:11 am
Viewing 15 posts - 811 through 825 (of 1,183 total)