Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

SQL Querry

Posted on 2012-08-16
9
Medium Priority
?
623 Views
Last Modified: 2012-08-21
How can I insert a single value into a single column by specifying the where clause?
0
Comment
Question by:pauledwardian
9 Comments
 
LVL 13

Expert Comment

by:AielloJ
ID: 38301393
pauledwardian:

Is there only 1 column in the table?  Does the row already exist?

AielloJ
0
 
LVL 66

Accepted Solution

by:
Jim Horn earned 1500 total points
ID: 38301415
-- If you're creating new rows...
INSERT INTO TableA (column1)
SELECT VALUES('banana')


-- If you're changing values in existing rows
UPDATE TableA
SET column1 = 'banana'
WHERE SomeOtherColumn = SomeValue
0
 

Author Comment

by:pauledwardian
ID: 38301606
by the way, do you guys know how can I replace comma in access with -in a particualr column? Like an access querry?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 66

Expert Comment

by:Jim Horn
ID: 38301840
In Access VBA, if we're talking a string value, then use replace:

Dim str As String
str = "123,456"

MsgBox Replace(str, ",", "-")

Open in new window


If something else, let us know.
0
 
LVL 66

Expert Comment

by:Jim Horn
ID: 38301852
Still need some more details from you (AielloJ's comment), whether you are creating new records (INSERT) or changing existing records (UPDATE).
0
 
LVL 32

Expert Comment

by:awking00
ID: 38301879
Perhaps you can provide us with what you have and what you want to help clarify what it is you're trying to accomplish.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 38302699
Topics: MS SQL Server, Databases Miscellaneous, SQL Server 2008
Since you are using an MS Access database you should request that the MS SQL Server and SQL Server 2008 topics be replaced with the more appropriate MS Access topic.
0
 

Author Closing Comment

by:pauledwardian
ID: 38317495
Thanks!
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question