Viewing 15 posts - 7,426 through 7,440 (of 10,143 total)
You forgot to correlate your correlated subquery:
SELECT OwnerStaff_Branch,
COUNT(WorkOrderID) AS MonthTotal,
(SELECT COUNT(WorkOrderID) AS Expr1
FROM WorkOrderReportView
WHERE (dbo.DateOnly(CreatedOn) = dbo.DateOnly(GETDATE())
AND OwnerStaff_Branch = w.OwnerStaff_Branch)
) AS DailyTotal
FROM WorkOrderReportView w
WHERE (MONTH(CreatedOn) = MONTH(GETDATE())) AND (YEAR(CreatedOn)...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
September 9, 2010 at 9:12 am
The check for existence looks way too complicated - this should work:
INSERT INTO SERVERS_V
(
SERVER_ID,
SERVER_NAME,
SERVER_MAKE,
.
.
.
SERVER_TIMEZONE
)
SELECT
SERVER_ID,
SERVER_NAME,
SERVER_MAKE,
.
.
.
SERVER_TIMEZONE
FROM SERVERS_VT
WHERE NOT EXISTS (SELECT 1 FROM SERVERS_V WHERE SERVER_ID = SERVERS_VT.SERVER_ID)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
September 9, 2010 at 8:49 am
Vasudev Tantry (9/9/2010)
Thanks Crazy..
You're welcome, Forum Newbie 😛
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
September 9, 2010 at 8:10 am
Use CASE.
IF enables you to distinguish between statements, CASE enables you to distinguish between values.
SELECT
c.c_fname AS [First Name],
c.c_lname AS [Last Name],
c.c_nick_name AS [Emp Id],
b.b_number_str AS [Card...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
September 9, 2010 at 7:10 am
Jack Corbett (9/9/2010)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
September 9, 2010 at 6:22 am
Whether you're permy or contracting, it seems to me that the three KPIs affecting happiness at work are money, people, and the actual work you're doing.
All three and you're...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
September 9, 2010 at 5:59 am
chetanr.jain (9/8/2010)
I require a little help on string query.
I have two table ( Table A and Table B) each having employee column with string values.
I want to search that does...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
September 9, 2010 at 5:44 am
Jeff Moden (9/9/2010)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
September 9, 2010 at 5:36 am
declare @returnvalue float
set @ReturnValue = ((6840844991.81 + 113664947.42) - (6947944500.34 + 2417617.57)) / (6947944500.34 + 2417617.57)
SELECT @ReturnValue --this is the correct calculated float number
-- truncate to 16dp
SELECT CONVERT(DECIMAL(26,16),@ReturnValue)
-- Use...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
September 9, 2010 at 5:08 am
Surely this would be tons easier and quicker if you were to normalise out the categories quite early on?
DROP TABLE #Temp
CREATE TABLE #Temp (ID INT IDENTITY(1,1), Name VARCHAR(30), [Address] VARCHAR(60),...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
September 9, 2010 at 2:46 am
WayneS (9/8/2010)
Chris Morris-439714 (9/8/2010)
WayneS (9/8/2010)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
September 8, 2010 at 9:40 am
WayneS (9/8/2010)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
September 8, 2010 at 9:26 am
CirquedeSQLeil (9/8/2010)
Chris Morris-439714 (9/8/2010)
CirquedeSQLeil (9/8/2010)
eep opp ork ah ahLike a Richmond sausage, you know there's pork in there somewhere.
p ork ahhhhhh
LOL
You need one of those dandy 360o sofas.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
September 8, 2010 at 9:19 am
CirquedeSQLeil (9/8/2010)
eep opp ork ah ah
Like a Richmond sausage, you know there's pork in there somewhere.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
September 8, 2010 at 9:02 am
-- generate a row for every unit bought / sold.
-- I guess this could be adapted to use the least common denominator
-- Another possibility is to use an iTVF (inline...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
September 8, 2010 at 8:33 am
Viewing 15 posts - 7,426 through 7,440 (of 10,143 total)