Viewing 15 posts - 4,801 through 4,815 (of 8,731 total)
sgmunson (6/19/2015)
DECLARE @Spec1 AS TABLE (
Spec1ID int IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED,
Channel int NOT NULL,
[Timestamp] datetime NOT NULL,
Lambda decimal(8, 2) NOT...
June 19, 2015 at 9:30 am
First attempt on getting this query working using Sean's sample data.
WITH cteCs AS(
select *,
ROW_NUMBER() OVER(PARTITION BY [Week],...
June 19, 2015 at 9:23 am
ScottPletcher (5/13/2015)
Before that you may want to try:EXEC sp_refreshview
on that view.
You mean sp_refreshsqlmodule because it's a UDF. 😉
June 18, 2015 at 12:14 pm
You could also correct the source if at all possible,
Here's an example using AdventureWorks2012
SELECT a.AddressID,
a.AddressLine1,
a.AddressLine2,
a.City,...
June 18, 2015 at 11:52 am
I posted 2 options. The first is called cross tabs and the second one uses the PIVOT operator.
You can read more about this approaches in here: http://www.sqlservercentral.com/articles/T-SQL/63681/
I also posted...
June 17, 2015 at 11:13 am
Just remember that there's no order inside a table. There's an order inside a flat file, but there's no certainty that SQL Server will load it in the same order.
That...
June 16, 2015 at 7:33 pm
How do you identify each group that you're converting to a row? You're missing the E on your EAV design.
June 16, 2015 at 4:14 pm
You need to pay more attention to details.
You are missing one parenthesis in your second option and the target data type in the first one.
The precision in decimal indicates the...
June 16, 2015 at 3:17 pm
This can be solved by adding one more ROW_NUMBER() function to create groups based on the SalesRep.
WITH
cteCust (RowNum, CustomerNumber, Division, SalesRepType, SalesRepNumber, BeginDate)
AS
(
SELECT
ROW_NUMBER() OVER (PARTITION By CustomerNumber, Division, SalesRepType...
June 16, 2015 at 3:06 pm
Lynn Pettis (6/16/2015)
SolveSQL (6/16/2015)
Appreciate the response.
Basically, it is the same reason just not positional based. All values returned in the CASE statement must be of the same data type....
June 16, 2015 at 2:43 pm
TomThomson (6/16/2015)
dwain.c (6/15/2015)
Here's one for the hard-core Sci-Fi fans out there:Size Comparison - Science Fiction Spaceships
Count me among 'em.
Why no Dahak?
I couldn't even find the Millenium Falcon.
June 16, 2015 at 2:23 pm
You're doing an inner join with Table3. Are you sure that Table3 has the rows needed?
June 16, 2015 at 12:17 pm
Ed Wagner (6/16/2015)
ChrisM@Work (6/16/2015)
j.grimanis (6/15/2015)
I have a procedure which inside I call two other Procedures, the first one is updating table Purchase Order and the second one is updating an...
June 16, 2015 at 10:27 am
gazy007 (6/16/2015)
I managed to change and get this working so far
"ELECT
CompanyName, CustomerAccount.AccountNumber ,
SUM( CASE WHEN YEAR( DateEntered) = YEAR(DATEADD(YY, -4, GETDATE())) THEN (SalesLine.OrderQuantity*SalesLine.SellingPrice...
June 16, 2015 at 9:29 am
j.grimanis (6/16/2015)
June 16, 2015 at 9:10 am
Viewing 15 posts - 4,801 through 4,815 (of 8,731 total)