|
-
Jun 22nd, 2000, 09:06 AM
#1
Thread Starter
Addicted Member
is there a way to do this with a case statement?
update #totals
set cutoff = '3:00pm'
where id in (14,15)
update #totals
set cutoff = '1:00pm'
where id in (16)
update #totals
set cutoff = '12:00pm'
where id in (17,18,19,20)
update #totals
set cutoff = '9:00am'
where id in (21)
update #totals
set cutoff = '2:40pm'
where id in (22)
-
Jun 22nd, 2000, 06:57 PM
#2
Lively Member
Yes (MS SQL Server 7.0):
UPDATE #totals set cutoff =
CASE id
when 14 then '3:00pm'
when 15 then '3:00pm'
when 16 then '1:00pm
...
END
That's it!
Roger
-
Jun 22nd, 2000, 11:57 PM
#3
case is available in SQL Server 6.5 too!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|