Viewing 15 posts - 46 through 60 (of 154 total)
Hi,
This query..
select distinct id,
count(id) as id_counter
from x
where id_counter > 1
wouldnt work because you are using a aggregate in the select list - you need to use group by...
May 29, 2003 at 6:48 am
you have the parameters switched wrong
also it might be a good idea to out the newline character too
REPLACE(REPLACE(mystring,CHAR(13),''),CHAR(10),'')
May 28, 2003 at 2:28 am
is this what you are looking for
SELECT
SD.permnum,
SD.firstname,
SD.lastname,
SD.grade,
TT.firstname AS TeacherFName,
TT.lastname AS TeacherLName,
SUM(CASE SC.TestShortName
WHEN 'HMRP' THEN
CASE
WHEN SC.TestScore < 70 THEN SC.TestScore
ELSE NULL
END
ELSE NULL
END) AS PreTest,
SUM(CASE...
May 28, 2003 at 12:18 am
try this
DECLARE @RandomValues TABLE
(
RandValint
)
DECLARE @Tbl TABLE
(
Idint identity,
RandValint
)
INSERT INTO @RandomValues
VALUES (1)
INSERT INTO @RandomValues
VALUES (4)
INSERT INTO @RandomValues
VALUES (6)
INSERT INTO @RandomValues
VALUES (10)
INSERT INTO @Tbl (RandVal)
VALUES (NULL)
INSERT INTO @Tbl (RandVal)
VALUES (NULL)
INSERT INTO @Tbl (RandVal)
VALUES...
May 27, 2003 at 8:16 am
This script should list all directories for you
USE PUBS
DECLARE @CmdStr varchar(100),@PathName varchar(200)
CREATE TABLE #Directories
(
DirectoryNamevarchar(100)
)
SET @PathName = 'C:'
SET @CmdStr = 'DIR ' + @PathName + ' /A:d /B'
INSERT INTO #Directories
EXEC...
May 27, 2003 at 3:15 am
EXEC sp_spaceused <tablename>
May 27, 2003 at 12:58 am
Have you considered using the BINARY_CHECKSUM(*) Function -
May 26, 2003 at 1:42 am
very rough solution
Returns the Keyholder with the start record for the specified period
USE PUBS
DECLARE @key TABLE
(
Tidint identity,
KeyHolderchar(3),
Accesseddatetime
)
INSERT INTO @key (KeyHolder,Accessed)
VALUES ('AAA' , '2003-05-23 16:27:00.100')
INSERT INTO
May 23, 2003 at 5:11 am
you can use EXISTS
SELECT ProductId
FROM tblProduct
WHERE EXISTS (
SELECT 1
FROM TblStoreInventory
WHERE TblStoreInventory.ProductId = tblProduct.ProductId
)
--RETURN PRODUCTS IN INVENTORY
SELECT ProductId
FROM tblProduct
WHERE NOT...
May 23, 2003 at 4:46 am
worked fine for me -
didnt return records for tempdb and model- because it doesnt have any user tables.
May 23, 2003 at 12:21 am
This one does not need a temp table
USE PUBS
DECLARE @STRnvarchar(200),
@Parm nvarchar(20),
@Cntint
SET @STR = 'SELECT @Cnt= COUNT(*) FROM Authors'
SET @Parm = '@Cnt int output'
EXEC...
May 23, 2003 at 12:10 am
Looks like your joins are ther problem
if you had rep 1 in reps
and 10 recs in accounts for that rep +
10 recs in seminars - you would get 1 *...
May 21, 2003 at 6:24 am
hmm...you are right - sorry should have checked what i was posting - my mistake
Thanks
May 20, 2003 at 7:23 am
Sorry,
select @datestr = cast(year(@todate) as char(4)) + '-' + cast(month(@DOB) as char(2)) + '-' + cast(day(@Dob) as char(2))
DOB might be a leap day as you said
but todate is presumably...
May 16, 2003 at 8:01 am
Might be a good idea to handle leap years here ..
May 16, 2003 at 7:35 am
Viewing 15 posts - 46 through 60 (of 154 total)