Viewing 15 posts - 1 through 15 (of 17 total)
Lol, I was half way there, Write a Stored Procedure utilizing a "function".
CREATE FUNCTION ODD_or_Even
(@Digit nvarchar(3))
RETURNS varchar(4)
AS BEGIN declare @Return varchar(30)
select @return = CASE WHEN
CAST(@Digit as decimal)/CAST(2...
October 24, 2013 at 11:49 am
CREATE FUNCTION ODD_or_Even
(@Digit nvarchar(3))
RETURNS varchar(4)
AS BEGIN declare @Return varchar(30)
select @return = CASE WHEN
CAST(@Digit as decimal)/CAST(2 AS decimal)NOT LIKE '%.0%' THEN 'Odd' ELSE 'Even' END
return
@return
end...
October 24, 2013 at 10:54 am
If it's a new server you migrated to, sometimes that server needs to be added to exchange.
October 17, 2013 at 12:12 pm
You could rename every file in the folder to "name_date". The "good" ones would stay the same and the "bad" would be modified like the others.
October 2, 2013 at 2:26 pm
You can also rename the file to your liking and then import.
October 2, 2013 at 12:36 pm
Similar -
WITH CTE AS (
SELECT Project
FROM Project_Category
WHERE Category = '3')
SELECT c.Project
FROM CTE c JOIN Project_Category p ON p.Project = c.Project AND p.Category = '6'
October 2, 2013 at 11:47 am
I believe you can get rid of the table variables altogether. Add the inner join used to populate the second table variable to the beginning of the first query to...
September 30, 2013 at 3:03 pm
A Sraight PIVOT could work too!
CREATe TABLE One(PoNum varchar(7),
Date varchar (15))
INSERT INTo One (PoNum, Date)
VALUES('P001', '2013-01-01'),
('P002', '2013-02-01' ),
('P003', '2013-02-10'),
('P004', '2013-03-01')
CREATe TABLE Two(PoNum varchar(7),
IteMRef varchar (15),
Qty int)
INSERT INTo Two (PoNum,...
September 30, 2013 at 11:18 am
SELECT
a.mins, a.stamp, b.mins, b.stamp
FROM
(SELECT min(value) as mins, min(t_stamp) as stamp
from @t
WHERE value = (SELECT min(value) FROM @t)) a,
(SELECT min(value) as mins, min(t_stamp) as stamp
from @t...
September 26, 2013 at 3:52 pm
Lol, CASE -
SELECT
AlternateName = CASE WHEN AlternateName = ' ' AND AlternateName1 <> ' '
THEN AlternateName1 WHEN AlternateName = ' ' AND AlternateName2...
September 19, 2013 at 1:11 pm
PIVOT -
SELECT [1870], [1880]
FROM
(select yr_died
from @1870_1880_DAT ) AS SourceTable
--GROUP BY EJTranID, BranchID
PIVOT
(
Count(yr_died)
FOR yr_died IN ( [1870], [1880])
) AS PivotTable;
September 18, 2013 at 2:52 pm
To Delete-
WITH CTE AS (SELECT keys, month, MIN(Usage) AS Usage
FROM #deletion
GROUP BY keys, month)
DELETE d
FROM #deletion d
...
September 17, 2013 at 4:10 pm
Viewing 15 posts - 1 through 15 (of 17 total)