Viewing 15 posts - 1,276 through 1,290 (of 2,171 total)
UPDATEy
SETy.InvalidFlag = 6
FROMtb_LeadBox AS y
LEFT JOIN(
SELECTMIN(UId2) AS UId2
FROMtb_LeadBox
WHEREEntryDate >= DATEADD(YEAR, -1, GETDATE())
GROUP BYFName,
LName,
HomePhone
) AS x ON x.UId2 = y.UId2
WHEREx.UId2 IS NULL
AND y.InvalidFlag IN (0, 1, 2, 3, 4, 6, 7,...
October 2, 2007 at 12:15 am
October 1, 2007 at 8:28 am
Also read this article about DATEDIFF
http://www.sqlteam.com/article/datediff-function-demystified
September 28, 2007 at 8:27 am
Script out all SP and functions to a text file.
Open the text file on the new server and run the code.
September 27, 2007 at 1:03 am
Keep track of your operator presedence!
UPDATE wjam
SET wjam.Bin = iw.DefaultBin
FROM dbo.WipJobAllMat AS wjam
INNER JOIN dbo.InvWarehouse AS iw ON iw.StockCode = wjam.StockCode
INNER JOIN dbo.WipMaster AS wm ON wm.Job = wjam.Job
WHERE wm.Complete...
September 26, 2007 at 8:32 am
September 26, 2007 at 8:27 am
;WITH Yak (ID1, ID2, RecID, RowID)
AS (
SELECTes1.EventSegment_ID,
es2.EventSegment_ID,
ROW_NUMBER() OVER (PARTITION BY es1.Location_Code, es1.Activity_ID ORDER BY es1.StartTime DESC) AS RecID,
COUNT(*) OVER (PARTITION BY es1.EventSegment_ID) AS RowID
FROM#EventSegment AS es1
LEFT JOIN#EventSegment AS es2 ON...
September 26, 2007 at 8:05 am
Wait a minute? What is the objective here?
1) Same week (sun-sat or mon-sun)
2) Any "7-day period" starting with first non-sequential date?
September 26, 2007 at 7:31 am
September 26, 2007 at 5:05 am
And you got a LOT of help here!!!
September 26, 2007 at 4:57 am
Read about ROUND function in Books Online.
It takes three parameters
1. The value
2. Number of decimals
3. Round or truncate
September 24, 2007 at 1:27 pm
How is your statistics?
You are missing a ) in the code above.
SELECT ACCTNUM,
ENTITYID,
PERIOD,
BALFOR,
SUM(ACTIVITY) AS ACTIVITY
September 20, 2007 at 2:06 am
Field1 is already VARCHAR? And Field2 is INT?
CAST(FIELD1 AS varchar(10)) + '/' + FIELD2 As fulltext,
Field1 + '/' + CONVERT(VARCHAR, Field2) AS FullText
September 19, 2007 at 8:08 am
You can also use the fnParseString function found here
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=76033
Use the second version.
September 19, 2007 at 8:06 am
If you are concerned about speed, Ray's solution will not make use of any present index. Making a calculation with the indexed column renders the index useless.
September 19, 2007 at 8:04 am
Viewing 15 posts - 1,276 through 1,290 (of 2,171 total)