Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

SQL Update statement with column variable

$
0
0

I have the below sql statement so far in VBScript. The School Column could have multiple possiblities for the value. For Example School=variable1.value, School=Variable2.value.

Can SET achieve this for me or do I need to go another route?

Thanks in advance.

SQL
SQL="SELECT ID FROM [Tbl Field Trip] WHERE ID='"&FT.Value&"' UPDATE [Tbl Field Trip]"&_" SET SignTeacher='"&Teacher.Value&"',"&_"DateEnt='"&DateEntered.Value&"',"&_"StudCnt='"&StudentNumber.Value&"',"&_"Grade='"&Grade.Value&"',"&_"DateDpt='"&DataFT.Value&"',"&_"Dept='"&Dept.Value&"',"&_"DST='"&DEST.Value&"',"&_"[Due Date]='"&permdue.Value&"',"&_"School='"&Central.Value&"'"&_"WHERE ID='"&FT.Value&"'"

Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>