Viewing 15 posts - 121 through 135 (of 321 total)
declare @t table
(Location int,
Item int,
SalesWeek int,
Qty int)
insert into @t
select 1,1,1,1 union all
select 1,1,2,6 union all
select 1,1,3,5 union all
select 1,1,4,2 union all
select 1,1,5,7 union all
select 2,1,1,4 union all
select 2,1,2,1 union...
August 31, 2005 at 11:04 am
Is this a catch or a bad request ???
"PK is location, item, salesweek.
Tables contains records for many locations for many weeks for many items. I need to remove the
August 31, 2005 at 9:56 am
delete svtcs
where code in ('Pause','Pause1','Pause2','Shift','Lunch')
delete svtcs
where code in ('CS','OE','Home') and Groupid = 20
--can be
delete svtcs
where code in ('Pause','Pause1','Pause2','Shift','Lunch')
or (code in ('CS','OE','Home') and Groupid = 20)
--7.identify the Personalnumber
update svavaya
set personalnummer =...
August 31, 2005 at 7:51 am
--the second part
update svlisteks
set sollstart=a.sollstart,sollstop=a.sollstop, DEP=a.DEP
from
(
select sv.* from
svliste sv left outer join svlisteks svks
on svks.agent = sv.agent --same agent
and svks.datum=sv.datum --same datum
and ISNULL(sv.sollstart,'')=ISNULL(svks.sollstart,'')
and ISNULL(sv.sollstop,'')=ISNULL(svks.sollstop,'')
and ISNULL(sv.DEP,'')=ISNULL(svks.DEP,'')
where svks.agent IS...
August 30, 2005 at 2:59 pm
insert into svlisteks
select sv.* from
svliste sv left outer join svlisteks svks on
svks.agent=sv.agent
and
sv.datum=svks.Datum -- a record in svliste has a diff Datum than ANY in svlisteks for a certain agent
where
svks.agent...
August 30, 2005 at 12:55 pm
--if you want to ADD the changes
insert into svlisteks
select sv.* from
svliste sv left outer join svlisteks svks
on svks.agent = sv.agent --same agent
and svks.datum=sv.datum and --same datum
sv.sollstart=svks.sollstart and sv.sollstop=svks.sollstop and sv.DEP=svks.DEP where sv.agent IS...
August 30, 2005 at 10:11 am
--first part INSERT missing records in svlisteks
insert into svlisteks
select sv.* from
svliste sv left outer join svlisteks svks on
svks.agent=sv.agent
where
sv.datum<>svks.Datum -- a record in svliste has a diff Datum than...
August 30, 2005 at 10:04 am
Still didn't respond to what means a change!
For example :
- INSERT when into svlisteks from svliste when the agent's record is NOT in svlisteks but EXISTS in svliste
-INSERT into svlisteks...
August 30, 2005 at 9:05 am
"I only want the changes update."
What do you consider change?
ONLY the new records in svliste?
August 30, 2005 at 8:31 am
SELECT
PriceDate,
PortName,
'Amount1' = SUM(CASE WHEN TransCatCode='005'THEN BaseSettleAmt ELSE 0 END),
'Amount2' = SUM(CASE WHEN TransCatCode='010'THEN BaseSettleAmt ELSE 0 END),
'Par'=SUM(CASE WHEN TransCatCode='005'THEN BaseSettleAmt WHEN TransCatCode='010' THEN -BaseSettleAmt ELSE 0 END)/1000
FROM Table1
WHERE SUBSTRING(PortName, 1,...
August 30, 2005 at 8:24 am
Can't figure out what you need : (( The second part retrieves the first record that you posted...
select sv.* from
svliste sv left outer join svlisteks svks on
svks.agent=sv.agent
where svks.agent is...
August 30, 2005 at 7:54 am
Thomas because your only problem is that update just put here the DDL for svlisteks, svliste and some sample (5-10 rows) date in each one and the result that you...
August 29, 2005 at 9:28 am
CREATE TRIGGER IDU_tblmembers
ON tblmembers
FOR INSERT, UPDATE, DELETE
AS
INSERT INTO TX_tblmembers
Select ID, fname, lname, address,newid(),'d',getdate(),0 from deleted
INSERT INTO TX_tblmembers
Select ID, fname, lname, address,newid(),'i',getdate(),0 from inserted
August 29, 2005 at 8:45 am
Viewing 15 posts - 121 through 135 (of 321 total)