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)
 Query Help

Author  Topic 

nicka
Starting Member

28 Posts

Posted - 2002-06-07 : 14:30:59
UPDATE tblQuote INNER JOIN tblProduct ON [tblQuote].[QtdProductName]=[tblProduct].[ProductName] SET tblQuote.QtdProductID = [tblProduct].[ProductID];

I have this working query. I need to make it update "QtdProductID" in tblQuote ONLY if it is Blank or empty.

Thanks for the help

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-06-07 : 14:43:11
What RDBMS are you running? You have posted several question on this board with very strange syntax. As I said in a previous thread, this is illegal syntax (SQL Server, ANSI Standard or otherwise) for an UPDATE statement. The INNER JOIN must be in a FROM clause.

You need a WHERE clause to do what you want....

WHERE coalesce(tblQuote.QtdProductID,'') = ''

<O>
Go to Top of Page

nicka
Starting Member

28 Posts

Posted - 2002-06-07 : 14:52:51
MS Access and the query is running fine but I need it to only update blank fields.

Go to Top of Page

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-06-07 : 15:56:46
ok, then

where iif(isnull(tblquote.qtdproductid),"",tblquote.qtdproductid) = ""

<O>
Go to Top of Page
   

- Advertisement -