Viewing 15 posts - 46 through 60 (of 5,355 total)
The boolean predicate is NOT behaving as expected! I expected it to return TRUE or FALSE based on the argument...it does not do...
December 15, 2005 at 7:14 am
No. The boolean predicate is working as expected. However when dealing with NULLs you face the Three-valued logic of NULL. Anything compared with NULL yields NULL (or UNKNOWN, for that...
December 14, 2005 at 8:03 am
select DATEADD(d, -1, DATEADD(m, DATEDIFF(m, '1900-1-1', getdate()) + 1, '1900-1-1'))
won't catch any row on that day with a time portion > 00:00:00.000. If your data contains a time portion, such...
December 9, 2005 at 7:15 am
CREATE TABLE t
(
k1 INT NOT NULL
, c1 CHAR NOT NULL
CONSTRAINT pk_t PRIMARY KEY(k1)
)
GO
CREATE FUNCTION dbo.CloseMyGaps() RETURNS INT
AS
BEGIN
RETURN
CASE
WHEN EXISTS
(SELECT *
FROM t
WHERE k1 = 1)
...
December 9, 2005 at 6:24 am
Something like this?
DECLARE @a VARCHAR(20)
SET @a = 'TW11 7PR'
SELECT LEFT(@a,PATINDEX('%[0-9]%',@a)-1)
SET @a = 'TESTME_All OVER11 7PR'
SELECT LEFT(@a,PATINDEX('%[0-9]%',@a)-1)
--------------------
TW
(1 row(s) affected)
--------------------
TESTME_All OVER
(1 row(s)...
November 28, 2005 at 5:05 am
Check this out: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part2/c0761.mspx
November 25, 2005 at 4:43 am
midan1,
not to sound offending here, but I remember several threads started by you about this issue or *very* similar issues. Haven't all the answers you got there helped?
Please think about your exact...
November 25, 2005 at 4:09 am
Caution with the time portion of GETDATE()!
SELECT GETDATE()-14
------------------------------------------------------
2005-11-11 11:36:06.320
(1 row(s) affected)
If you have any time portion in your data you might not catch data from 2005-11-11 entered earlierer...
November 25, 2005 at 4:00 am
Oh, btw, Jeff, I'm not adding 31 days. I only use a different base date.
November 24, 2005 at 1:46 am
...and finally...
SELECT DATEADD(mm,DATEDIFF(mm,0,GETDATE()),0)
, DATEADD(mm,DATEDIFF(mm,-1,GETDATE()),0)
November 24, 2005 at 1:44 am
Since you already have a good solution for the first day in a month with
select DATEADD(m,DATEDIFF(m,0,GETDATE()),0)
Why not use this to get the last day in a month, too?
select DATEADD(m,DATEDIFF(m,0,GETDATE()),31)
November 24, 2005 at 1:34 am
Dynamic SQL. Basically you build your query string at runtime and execute it via sp_ExecuteSQL or EXEC(). See if this helps: http://www.sommarskog.se/dynamic_sql.html
November 23, 2005 at 7:17 am
Btw, are you the guy who has developed the Mambo/Joomla Bookmarks component?
November 23, 2005 at 7:14 am
DECLARE @a VARCHAR(30)
SET @a = 'like if we do it for: i'+'x'
SELECT LEN(@a), LEN(REPLACE(@a, 'i', ''))
----------- -----------
24 20
(1 row(s) affected)
Caution when there is a...
November 23, 2005 at 7:13 am
Viewing 15 posts - 46 through 60 (of 5,355 total)