Viewing 9 posts - 1 through 9 (of 9 total)
yup, that one did the trick! thanks mate.
March 25, 2010 at 12:04 pm
you may be able to do it using "row_number" with "partition" by drive and "order" by date in descending order, then filter out those items that are not 1 in...
March 4, 2010 at 3:38 pm
sorry just noticed that the department is not primary 😛
February 25, 2010 at 1:08 pm
your update statement would be something like (untested code):
UPDATE Departments
SET DeptSeq = cte.deptSeq
FROM (
SELECT Department, ROW_NUMBER() OVER (Partition By Department Order By department) AS...
February 25, 2010 at 12:44 pm
using this with more than 100 rows with the recursive option set to 0, makes it slower that using the while version of it 🙁
February 24, 2010 at 1:48 pm
if you could provide us a more detailed description of the columns and formula, i think it would be easier to assist you.
February 19, 2010 at 2:34 pm
sorry forgot to add the full script 😛
CREATE TABLE [dbo].[dfi_inv_master_list](
[acct_code] [int] IDENTITY(1,1) NOT NULL,
[part_no] [int] NULL,
[location] [int] NULL,
[description] [int] NULL,
[sku_no] [int] NULL,
[list_status] [int] NULL,
[pub_date] [int] NULL,
[pub_status] [int] NULL,
[succession_status] [int] NULL,
[void]...
October 8, 2009 at 8:02 pm
changed the where a bit, tested with 100,000 rows:
SELECT * FROM (
select acct_code, part_no,location,description,sku_no,list_status
,pub_date,pub_status,succession_status,void,in_stock,avg_cost
,std_cost
,((avg_cost - std_cost)/avg_cost)*100 as unit_cost_var
,(avg_cost - std_cost)*in_stock as extended_diff
,in_stock*avg_cost as extended_avg_cost
from dfi_inv_master_list with (NOLOCK)...
October 8, 2009 at 4:45 pm
thanks a lot mate, that looks even better 😀
January 22, 2009 at 8:23 am
Viewing 9 posts - 1 through 9 (of 9 total)