Viewing 15 posts - 1,201 through 1,215 (of 2,007 total)
L' Eomot InversΓ© (12/8/2011)
December 8, 2011 at 8:09 am
Sorry, lost track of this thread.
It sounds like what you want to do should be possible in one query. Can you provide me with expected result from the sample data...
December 8, 2011 at 6:44 am
Ninja's_RGR'us (12/8/2011)
Cadavre (12/8/2011)
SELECT STUFF((SELECT ',' + newRow
FROM (SELECT CONVERT(VARCHAR(4),newRow) AS newRow
...
December 8, 2011 at 6:29 am
Daniel Bowlin (12/7/2011)
SELECT DATEDIFF(dd,GetDate(),'12/25/11') AS DaysTillChristmas
Just to over-complicate matters . . . π
SELECT CASE WHEN GETDATE() > DATEADD(d, 24, DATEADD(m, 11, DATEADD(yy, DATEDIFF(yy, 0, GETDATE()), 0)))
...
December 8, 2011 at 5:44 am
Koen Verbeeck (12/8/2011)
(http://www.sqlservercentral.com/Forums)
However, the link http://www.sqlservercentral.com/forums - with a lower f - works.
The forums themselves...
December 8, 2011 at 4:13 am
Here's a FOR XML PATH version.
SELECT STUFF((SELECT ',' + newRow
FROM (SELECT CONVERT(VARCHAR(4),newRow) AS newRow
...
December 8, 2011 at 4:08 am
Dev (12/7/2011)
Cadavre (12/7/2011)
Dev (12/7/2011)
Welcome to the discussion!But that statement is for a table with 2 rows. π
The number of rows is irrelevant, the statement is...
December 7, 2011 at 7:37 am
Dev (12/7/2011)
Welcome to the discussion!But that statement is for a table with 2 rows. π
The number of rows is irrelevant, the statement is incorrect.
December 7, 2011 at 7:27 am
Dev (12/7/2011)
And that's precisely my point. Plus, it can cache complete table in memory.
OH FOR THE LOVE OF . . . . !
I've had that argument so...
December 7, 2011 at 7:20 am
You're going about it wrong.
Try this
BEGIN TRAN
--Sample data
SELECT ItemId, MarketPriceSource, StartDate, EndDate, CollectGoods, W_house
INTO #tmpOutput
FROM (SELECT 'P12000', 'Missing', '2012-05-01', '2012-05-31', 0, 'CUP'
UNION ALL SELECT...
December 7, 2011 at 7:14 am
david.ostrander (12/7/2011)
FROM Resources r WITH(NOLOCK)
INNER JOIN Workgroupmember wgm WITH(NOLOCK) ON wgm.ResourceID = R.ResourceID and wgm.historical = 0
INNER JOIN Workgroup rw WITH(NOLOCK) ON rw.workgroupid =...
December 7, 2011 at 6:59 am
Not sure I understand what you're after. Try these two queries to see if they help.
BEGIN TRAN
--Sample Data
SELECT RowID, Color, Salesman
INTO #sales
FROM (SELECT 1, 'blue', 'bob'
...
December 7, 2011 at 1:44 am
drew.allen (12/6/2011)
Cadavre (12/6/2011)
For your own sanity, or that of whoever has to maintain this monster, try this instead: -
I would go even further. For your own sanity, your whole...
December 6, 2011 at 9:13 am
Steve Jones - SSC Editor (12/6/2011)
Prolonging or repeating yourself doesn't help, and it ultimately clutters the thread up with arguments or nonsense. Ask once, repeat, then move on. You...
December 6, 2011 at 9:03 am
For your own sanity, or that of whoever has to maintain this monster, try this instead: -
SELECT id, dateFormula - (yearFormula+monthFormula) AS totaldays,
(dateFormula - (yearFormula+monthFormula)) % 2 AS premod
FROM (SELECT...
December 6, 2011 at 8:39 am
Viewing 15 posts - 1,201 through 1,215 (of 2,007 total)