Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update one field

Status
Not open for further replies.

samauto

IS-IT--Management
Dec 19, 2000
7
US
I have a table in a Access Database that I would like to update only one field and leave the rest of the fields alone. How can I do that?
 
I believe this will do what you want.

<cfquery name=&quot;q1&quot; datasource=&quot;myDsn&quot;>
update table1
set field1 = '#textValue#'
where recordID = #recNum#
</cfquery>

If the field is a numeric field, change the ='textValue' to = #numberValue#. You put single quotes around text values and leave them off for numeric or date values. If you want to update all the rows and not just a single row, leave off the &quot;where recordID = #recNum#&quot;.

Hope this helps,
GJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top