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
 Transact-SQL (2000)
 update?

Author  Topic 

Dirty_Howi
Starting Member

12 Posts

Posted - 2005-04-20 : 10:24:47
according to my texts this should work...


update dbo.occurrence.historical
set historical=1
where
(SELECT dbo.occurrence_data.Start_Date, dbo.occurrence_data.Occurrence_ID
FROM dbo.occurrence_data INNER JOIN
dbo.OCCURRENCE ON dbo.occurrence_data.Occurrence_ID = dbo.OCCURRENCE.Occurrence_ID
WHERE (dbo.occurrence_data.Start_Date < DATEADD(d, - 366, GETDATE())))


but doesn't....AARRRGH

When i'm right, no one remembers, when i'm wrong no one forgets.

AndyB13
Aged Yak Warrior

583 Posts

Posted - 2005-04-20 : 11:15:36
Close, how about this?

update dbo.occurrence.historical
set historical=1
FROM dbo.OCCURRENCE INNER JOIN dbo.occurrence_data
ON dbo.OCCURRENCE.Occurrence_ID = dbo.occurrence_data.Occurrence_ID
WHERE (dbo.occurrence_data.Start_Date < DATEADD(d, - 366, GETDATE()))


Andy

Beauty is in the eyes of the beerholder
Go to Top of Page

Dirty_Howi
Starting Member

12 Posts

Posted - 2005-04-20 : 11:20:28
[font size=6] THANK YOU[/font]

i have been pulling my hair out on this for 3 stinking days

When i'm right, no one remembers, when i'm wrong no one forgets.
Go to Top of Page
   

- Advertisement -