Viewing 15 posts - 3,646 through 3,660 (of 5,504 total)
Something like this?
SELECT SUM(CASE WHEN daytype ='W' THEN 1 ELSE 0 END) as total_days
FROM TM_calendar
WHERE yourColumn>= @startDate
AND yourColumn<@endDate
April 28, 2010 at 12:51 pm
Here's a sample code that works as expected:
DECLARE @tbl TABLE ( float_column FLOAT )
INSERT INTO @tbl
SELECT 0 UNION ALL
SELECT 0.001 UNION ALL
SELECT -0.001 UNION ALL
SELECT -1110
SELECT *
FROM ...
April 28, 2010 at 12:23 pm
Your trigger code won't work as soon as there is more than 1 row affected.
You need to rethink your process to decide how to deal with that.
April 28, 2010 at 12:17 pm
Would you mind posting your solution? It might help others, too.
April 28, 2010 at 3:51 am
You'll (hopefully) find your answer over at stackoverflow... 😉
April 28, 2010 at 3:45 am
Maybe something like this?
WHERE float_column > = 0.0
April 28, 2010 at 3:43 am
Please provide table def and sample data as described in the first link in my signature.
It will help us to test our solutions.
April 28, 2010 at 3:42 am
Hard to tell without actually seeing the query that fails including the tables involved.
Please read and follow the first link in my signature on how to post data.
April 28, 2010 at 3:40 am
Lynn Pettis (4/27/2010)
April 27, 2010 at 4:36 pm
To make it even more interesting: Add a blank to your check value and it works just fine. Otherwise it will start to fail at '0.95'...
when ISNULL(@p1, '0.0') <> '0.0...
April 27, 2010 at 4:04 pm
Why don't you use the built-in functions STDEV() and AVG()?
Both ignore NULL values by default...
To check if at least one of your columns is null you could simply add those...
April 27, 2010 at 2:56 pm
What's the purpose of @vstextid?
If you would assign the value of TPM300_PAT_VISIT.vst_ext_id to it, your query would look like TPM300_PAT_VISIT.vst_ext_id=TPM300_PAT_VISIT.vst_ext_id which will return all rows...
Asking a little more in general:...
April 27, 2010 at 1:56 pm
There is no place in your code where you assign a value to @vstextid. Therefore, your WHERE clauses will most probably eleminate all rows.
Btw: what do you try to achieve...
April 27, 2010 at 1:37 pm
You might want to have a look at the CrossTab article referenced in my signature. This will show you an alternative to the PIVOT statement. If you need to display...
April 27, 2010 at 1:29 pm
like I said:
I can't think of a simple way to do it...
😉
April 27, 2010 at 1:21 pm
Viewing 15 posts - 3,646 through 3,660 (of 5,504 total)