Viewing 15 posts - 241 through 255 (of 430 total)
SET NOCOUNT ON
DECLARE @Book TABLE
(
bookID INT,
BookName VARCHAR(100)
)
DECLARE @Contributor TABLE
(
contributorid INT,
Contributor VARCHAR(100)
)
DECLARE @bookContributor TABLE
(
bookID INT,
contributorid INT
)
INSERT INTO @Book VALUES (1, 'Book1')
INSERT INTO @Book VALUES (2, 'Book2')
INSERT INTO @Book VALUES (3, 'Book3')
INSERT INTO @Book...
July 25, 2005 at 7:59 am
If there is a clustered index the rows will be in the order of the clustered index if not it will be in the order the data is inserted. See...
July 20, 2005 at 11:24 am
Not possible. The variable @rcount is out of scope in Dynamic SQL.
May be steev's answers in this helps
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=202194#bm202408
July 20, 2005 at 11:08 am
You cannot do it directly. Workaround
SET NOCOUNT ON
CREATE TABLE #_D_T_dep_tbl1
(
record_id INT,
Record VARCHAR(100)
)
INSERT INTO #_D_T_dep_tbl1 VALUES (12, 'AAAA')
INSERT INTO #_D_T_dep_tbl1 VALUES (24, 'BBBB')
INSERT INTO #_D_T_dep_tbl1 VALUES (36, 'CCCC')
INSERT INTO #_D_T_dep_tbl1 VALUES (48,...
July 19, 2005 at 9:14 am
If you last business day. This will not consider holidays other that Saturday and Sunday.
/* Previous months last business date */
SELECT DATEADD(DAY, DATEDIFF(DAY, DATEADD(MONTH, -1, GETDATE()), GETDATE()) - DATEPART(DAY, GETDATE())...
July 19, 2005 at 7:39 am
/* Previous months last date */
SELECT DATEADD(DAY, DATEDIFF(DAY, DATEADD(MONTH, -1, GETDATE()), GETDATE()) - DATEPART(DAY, GETDATE()), DATEADD(MONTH, -1, GETDATE()))
/* Current Months last date */
SELECT DATEADD(DAY, DATEDIFF(DAY, GETDATE(), DATEADD(MONTH, 1, GETDATE())) -...
July 18, 2005 at 3:11 pm
xp_cmdshell can be used to execute dos commands.
July 18, 2005 at 2:57 pm
My Mistake.
Correct answer is
SELECT A.Subscriber, AVG(CASE WHEN S.Average = 1 THEN A.Amount ELSE 0 END) AvgAmount
FROM
#tblTempRetros A
JOIN
#tblTempSubscriber S
ON
A.Subscriber = S.Subscriber
WHERE
3 > (SELECT COUNT(DISTINCT DateMonthEnd)
FROM
#tblTempRetros B
WHERE
B.Subscriber...
July 18, 2005 at 2:55 pm
HTH
Can you explain how do you get 5666 fro 2
DECLARE @MyDate DATETIME SET @MyDate = '3/31/2005'
SELECT A.Subscriber, AVG(CASE WHEN B.Average = 1 THEN A.Amount ELSE 0 END)
FROM
#tblTempRetros A
JOIN
#tblTempSubscriber B
ON
A.Subscriber =...
July 18, 2005 at 2:16 pm
declare @varCategory int
Select * from tblparticipants
Where
varCategory = CASE WHEN @varCategory IS NULL THEN varCategory ELSE @varCategory END
July 18, 2005 at 1:55 pm
I don't know about your data and table structure.
HTH.
SET NOCOUNT ON
DECLARE @EMails TABLE
(
EMAil VARCHAR(100)
)
INSERT @EMails
SELECT 'AAAA@AAAA.COM' UNION
SELECT 'BBBB@BBBB.COM' UNION
SELECT 'CCCC@CCCC.COM' UNION
SELECT 'DDDD@DDDD.COM' UNION
SELECT 'EEEE@EEEE.COM' UNION
SELECT 'FFFF@FFFF.COM' UNION
SELECT 'GGGG@GGGG.COM' UNION
SELECT...
July 18, 2005 at 1:51 pm
LIKE should go with %
email like (charindex(select Domain_Name from t_BLOCK_Emails),email)<0) and
email = (charindex(select Domain_Name from t_BLOCK_Emails),email)<0)
are the same.
charindex(select Domain_Name from t_BLOCK_Emails),email) < 0 would work for you I guess.
July 18, 2005 at 7:36 am
Thanks Ray.
I thought I presented my problem with two tables. Which I did not. It involves 5 tables and a count(IRNumber) along with Min(CaeRow).
I managed to make my query. Thanks...
July 11, 2005 at 5:37 pm
Like the original post can you give what is the desired output for both the parameters.
July 11, 2005 at 9:55 am
Viewing 15 posts - 241 through 255 (of 430 total)