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)
 Need help with UPDATE script

Author  Topic 

ImTheodore
Starting Member

16 Posts

Posted - 2007-07-24 : 21:18:38
I have to update certain values within a table. Below is the SELECT statement I use to find the values. I need to change the value of "VALUE" to be VALUE/1000

select * from timetable
where
time between '7/17/2007' and '7/24/2007'
and parameter in (290,656,655,653,654,641,291)
and value > 1000


If the above criteria is met, I need value= value/1000 (all of these values are 1000 times to high)

Thanks,
Dave

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-07-24 : 21:40:56
[code]UPDATE timetable
SET value = value / 1000
WHERE time BETWEEN '7/17/2007' AND '7/24/2007'
AND parameter IN (290,656,655,653,654,641,291)
AND value > 1000[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -