# How to update SQL query with an identifier has 2 strings

**URL:** <https://discourse.nodered.org/t/how-to-update-sql-query-with-an-identifier-has-2-strings/66647>\
**Category:** General\
**Created:** [19 August 2022 07:47 UTC](https://discourse.nodered.org/t/how-to-update-sql-query-with-an-identifier-has-2-strings/66647 "2022-08-19T07:47:57Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [19 August 2022 09:04 UTC](https://discourse.nodered.org/t/how-to-update-sql-query-with-an-identifier-has-2-strings/66647/6 "2022-08-19T09:04:15Z")

</div>

> [@Kimo](#):
>
> `WHERE [Name] = '"+Name+"'" `

that is not what I said to do...

> [@Steve-Mcl](#):
>
> `WHERE [name] IN ('A1','A2')`

e.g..

```auto
const array = flow.get('array'); //example ["A1", "A2"];
if(!array || !array.length) {
    node.warn("array is empty");
    return null // halt flow
}
const whereClause = "(" + array.map(e => "'" + e + "'").join(",") + ");"
const now = new Date().toLocaleString("en-GB");
msg.payload = "UPDATE [dbo].[Background] SET [Start_Time] = '" + now + "' WHERE [Name] in " + whereClause;
return msg;

```

---

_[View the full topic](https://discourse.nodered.org/t/how-to-update-sql-query-with-an-identifier-has-2-strings/66647)._
