<div>I'm not very familiar with MSSQL but I know in Oracle or PostgreSQL you could use some PL/SQL to handle this. It would resemble something like this:</div>
<div> </div>
<div>DECALRE SalesID NUMBER;</div>
<div> </div>
<div>BEGIN</div>
<div> SELECT ID INTO SalesID FROM <table_name> WHERE <condition>;</div>
<div> IF SalesID = NULL THEN</div>
<div> UPDATE <table_name> SET Close=Now() WHERE ID=SalesID;</div>
<div> END IF;</div>
<div>END;</div>
<div> </div>
<div>I'm sure that MSSQL probably supports PL/SQL as well, but the verbage may be different. Hope this helps.</div>
<div> </div>
<div>Jerry<br><br> </div>
<div><span class="gmail_quote">On 3/15/06, <b class="gmail_sendername">David Stout</b> <<a href="mailto:ragbrai65@yahoo.com">ragbrai65@yahoo.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div style="DIRECTION: ltr">
<div>I am using SQL server and I have a column named <br>SalesStatus and one Named Close in my in the SalesStatus field I have values like</div>
<div>BTO, Model, ssip, and Spec In the field named Close this is just a closing date.</div>
<div>What I need to do is this:</div>
<div> </div>
<div>If SalesStatus='Spec' Then put the value of the closed field in here. </div>
<div>else '<blank>'</div>
<div> </div>
<div>How do I write such a query?</div>
<div> </div>
<div>Thank you,</div></div>
<div style="DIRECTION: ltr"><span class="sg">
<div>David Stout</div>
<div><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Ragbari65@yahoo.com" target="_blank">Ragbari65@yahoo.com</a></div></span></div>
<div style="DIRECTION: ltr"><span class="ad">
<p>
<hr size="1">
Brings words and photos together (easily) with<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://us.rd.yahoo.com/mail_us/taglines/PMall/*http://photomail.mail.yahoo.com" target="_blank">PhotoMail
</a>- it's free and works with Yahoo! Mail.
<p></p></p></span></div><br>_______________________________________________<br>Cialug mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Cialug@cialug.org">Cialug@cialug.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://cialug.org/mailman/listinfo/cialug" target="_blank">
http://cialug.org/mailman/listinfo/cialug</a><br><br><br></blockquote></div><br>