Viewing 15 posts - 271 through 285 (of 1,923 total)
April 6, 2012 at 2:52 am
sbj1411 (4/5/2012)
April 5, 2012 at 4:18 pm
Welcome to sqlservercentral.com!
Please read through the following article on how to provide information to get the question answered.
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Your request will involve usage of XML and some GROUP BY clauses. Please...
April 5, 2012 at 4:07 pm
This?
SELECT C.CustomerName, Qty = SUM( S.Quantity ) ,Prc = SUM( P.Price)
FROM Customers AS C
INNER JOIN Sales AS S
ON C.CustomerName = S.CustomerName
INNER JOIN Products As P
ON S.ProductName = P.ProductName
GROUP BY C.CustomerName
April 5, 2012 at 12:33 pm
Can you populate the tables with some data? And to go with it, your expected result based off of that sample data!
April 5, 2012 at 11:54 am
Jeff Moden (4/4/2012)
ColdCoffee (4/4/2012)
April 4, 2012 at 7:53 pm
Jeff Moden (4/4/2012)
schillingt (4/3/2012)
The output from the stored proc [dbo].[rpt_sp_get_date_range] looks like this.StartDate EndDate
2012-04-01 00:00:00.0002012-04-07 23:59:59.999
Boy, are you...
April 4, 2012 at 7:24 pm
Aw no!!! Dont concatenate values into a single column. Normalize and seperate them out as columns which will save u time and money!
April 4, 2012 at 3:44 pm
Will all the rows follow the same pattern?
Country:<Countryname>, City:<cityname>
There wont be any extra data in that Location column, would it?
April 4, 2012 at 1:36 pm
My solution did not use CTEs, the CTE is built to hold your sample data! 😀
April 4, 2012 at 12:02 pm
Or this?
; WITH CTE(Strings) AS
(
SELECT 'AIT_FIT_projecto and moonbeat'
UNION ALL SELECT 'OEMR_FIT_projectofile where handled'
UNION ALL SELECT 'LO_FIT_pritibabe every way'
)
SELECT Strings,
Stuffed = STUFF(Strings,1,...
April 4, 2012 at 9:46 am
Jeff Moden (4/3/2012)
Ohhhhh, be careful, Craig
Jeff, it was posted by Cadavre (If cadavre's original name is Craig, i apologize for the nit-pick) 🙂
April 4, 2012 at 12:51 am
Extending the code:
DECLARE @InputDate DATETIME
-- Possible values 'DY' / 'WK' / 'MT' / 'YR'
...
April 3, 2012 at 4:01 pm
How about this?
DECLARE @InputDate DATETIME
SELECT @InputDate = '2012-04-08'
SELECT @InputDate = DATEADD(DD,DATEDIFF(DD,0, @InputDate),0)
;WITH OffsetCalendar (DayNam , StartIndex, EndIndex ) AS
(
...
April 3, 2012 at 2:56 pm
Viewing 15 posts - 271 through 285 (of 1,923 total)