Women in Technology

Hear us Roar



Article:
  SQL Subqueries
Subject:   SQL subquery help
Date:   2009-05-28 13:16:59
From:   w2kadmin
Hello all,
I am trying to run a query that allows me to update values only for a particular user and only with a time frame. The query runs but it updates the values for all users. What am I doing wrong?
Thanks very much for any help. Here's the query in 2 parts:
select [patid], [id] ,[date],[mssql_user],[type]
from [CVMSSQL].[dbo].[RVS]
where mssql_user = 'ghaft'


update [CVMSSQL].[dbo].[RVS]
set [type] = '1' where [type] = '7' and date between '2009-01-14' and '2009-01-14'