Viewing 15 posts - 331 through 345 (of 541 total)
Hello again. I have done a sanity check on the output when averaging the cost and the figures do not quite add up.
I averaged the costs of the last 5...
December 31, 2008 at 12:53 am
Thanks very much for your efforts, great work.
I amended to return average for the other costs rather than SUM.
Many Thanks,
Phil.
December 30, 2008 at 2:57 pm
I thought I would break the problem down and now have the following:
SELECT DISTINCT ProductId,OrderId,
ELEMENT1=
CASE
WHEN ELEMENT1 = 100 THEN 'MAN'
...
December 30, 2008 at 6:34 am
I have the following basic query that gives an average build cost without the summation of the individual elements.
SELECT DISTINCT COUNT(ProductId) AS ProductCount,ProductId, AVG(TotalCost) AS 'AVGBuildCost'
FROM dbo.Cost
WHERE TotalCost >'0'
GROUP...
December 30, 2008 at 6:09 am
I have successfully imported 164000 rows from .xlsx file (Office 2007) into SQL 2005 database (SP2).
The full article I followed can be read by clicking the link provided below:
The...
December 22, 2008 at 3:50 pm
Great work and many thanks. I rolled with Vladan example code (last post), worked a treat.
Once again many thanks to all those who posted, I really appreciate your time and...
December 22, 2008 at 11:10 am
Hi and thanks for posting. Yes Part Count is to capture how many times the Part has been ordered. I will implement your code and post back (table definition, sample...
December 22, 2008 at 2:06 am
Thanks for replying guys.
Seth I tried modifying your code, just working through the errors! 🙂
Steve I have not had much exposure to using HAVING + TOP so will have read...
December 21, 2008 at 11:25 am
Would be happy to. I will give it a go at the earliest opportunity and post back.
Kind Regards,
Phil.
December 21, 2008 at 11:20 am
To follow on. I have since remigrated the data. I cleaned up in excel first (reduced to 164000 records). I found that the TotalCost column had a - symbol (negative)...
December 21, 2008 at 3:09 am
I needed to make a slight modification (add GROUP BY) so code now reads as follows:
UPDATE p
SET p.MaterialCost = x.LabourCost
FROM dbo.Products As p
JOIN (
SELECT DISTINCT COUNT(ProductId)...
December 20, 2008 at 3:53 am
Thanks guys, my knowledge is improving but still lots to learn.
Phil.
December 19, 2008 at 12:39 pm
Hi. I managed to resolve the error SQL returned on CONVERT.
I used WHERE ISNUMERIC(TotalCost) <> 1
I deleted - from end of value and then ran:
SELECT ProductId, AVG(CONVERT(money,TotalCost)) AS 'Total'
FROM...
December 19, 2008 at 8:32 am
I have managed to format the month:
="TOTAL FOR MONTH:" & MonthName(MONTH(First(Fields!Date.Value, "dsBidReport")))
Regards,
Phil.
December 19, 2008 at 7:22 am
Viewing 15 posts - 331 through 345 (of 541 total)