Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Query

Author  Topic 

vicki
Posting Yak Master

117 Posts

Posted - 2001-10-10 : 09:31:07
Hi,

I have the question and hope some one here can answer for me.
The fiscal year is start at october so octobers is 1st month of the year.
Right now I have 52 weeks in the database and what I want now is if from now on
whatever I update in the database then it become the week 1 not week 53

Thanks

CREATE Procedure InsertOPMISummary
as

set datefirst 7

begin
Delete OPMISummary
insert into OPMISummary
select DOC,
Convert(smalldatetime,Run_Dte) as Run_Dte,
month(convert(smalldatetime, run_dte))<1o begin
datepart(wk,convert(datetime,Run_Dte)) + 13 as WeekNum,
end
else
begin
datepart(wk,convert(datetime, run_dte))-39 as weeknum
end



   

- Advertisement -