Viewing 15 posts - 4,036 through 4,050 (of 5,588 total)
Dominic Gagné (6/4/2010)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 4, 2010 at 7:57 am
You would order by the column alias - in this case, "Created Date".
ORDER BY [Created Date]
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 4, 2010 at 7:31 am
How about some input from fellow Threadizens on Who physically maintains your servers?
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 4, 2010 at 7:28 am
I think this might do it for you.
UPDATE a
SET ColumnA1 = CASE WHEN b.SomeTypeID = 1 THEN 1 ELSE a.ColumnA1 END,
...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 4, 2010 at 7:24 am
I bet if you put PivotTable in there, it would work.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 3, 2010 at 10:39 pm
Right before: EXEC SP_EXECUTESQL @PivotSQL
Put a "PRINT @PivotSQL" statement, then post the results.
Actually, if you look at it, I'll bet you can see the problem.
Another tip... if you add a...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 3, 2010 at 10:21 pm
Steve Jones - Editor (6/3/2010)
I'm sure they would pay $250/hr for 7 sec of advice. 😛
Minimum 4 hour 😀
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 3, 2010 at 10:13 pm
You're welcome. Did it do what you want it to do?
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 3, 2010 at 10:08 pm
Are you saying that if ColumnB has a decimal portion, that you don't want it?
You know, the people that help out here are all un-paid volunteers, so please HELP US...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 3, 2010 at 10:07 pm
If you have separate tables for each of the Field7 #'s, then you can:
1. get rid of adding the extra columns to #csvtest.
2. get rid of the dynamic sql.
3. duplicate...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 3, 2010 at 10:05 pm
Your block of code:
SET @PivotSQL = N'
SELECT
DataTable.*, (SELECT AVG(InclGST)
FROM Mobile
WHERE Month = ' + @CurrMonth + '
AND Year = ' + @CurrYear +') AS CurrMonthAvg
FROM
Needs to be:
SET @PivotSQL = N'
SELECT
DataTable.*,...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 3, 2010 at 9:54 pm
I think the last part of the where clause needs to be <, not <=.
Also, you might want to look at the "Common Date/Time Routines" link in my signature for...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 3, 2010 at 9:47 pm
SELECT DISTINCT
docno,
notetitle,
Notetext = STUFF((SELECT ' ' + NoteText
...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 3, 2010 at 9:43 pm
I would prefer the full-featured... but the time limit needs to be a least a month. Like you mentioned, all it takes is getting caught up in a few things...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 3, 2010 at 9:30 pm
If you have all of the record types, we can probably work something out. 🙂
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 3, 2010 at 9:27 pm
Viewing 15 posts - 4,036 through 4,050 (of 5,588 total)