Pls need help with update query

N

Nyrubi

I am adding to a field in the table: this is what I have to my update query:
[mytable].[comments] & " // " & [tabletoadd] However, I only want to add
comments if there are comments to add from [mytable]. How do I write this
in? Thank you very much.
 
J

Jerry Whittle

In the criteria under the comments field:

Is Not Null

In a sql statement:

WHERE [mytable].[comments] Is Not Null
 
N

Nyrubi

Thank you for your quick response. However, there may be comments into the
table I am going to update. So I need an IF statement. If there are
comments, enter if not then leave blank. Thank you.

Jerry Whittle said:
In the criteria under the comments field:

Is Not Null

In a sql statement:

WHERE [mytable].[comments] Is Not Null
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

Nyrubi said:
I am adding to a field in the table: this is what I have to my update query:
[mytable].[comments] & " // " & [tabletoadd] However, I only want to add
comments if there are comments to add from [mytable]. How do I write this
in? Thank you very much.
 
J

John W. Vinson

I am adding to a field in the table: this is what I have to my update query:
[mytable].[comments] & " // " & [tabletoadd] However, I only want to add
comments if there are comments to add from [mytable]. How do I write this
in? Thank you very much.

What do you want to have the query do if there are no comments? Nothing?

If so just use a criterion of

IS NOT NULL

on the Comments field; the query simply won't include any records where there
is nothing in the field.

It's not at all clear to me why you would want to store the comments
redundantly in a second table; sounds like a design flaw to me!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top