SQL statement to update boolean field

Post Reply
User avatar
Terkelsen
Advanced member
Posts: 252
Joined: Thu Sep 08, 2011 5:08 pm
Contact:

SQL statement to update boolean field

Post by Terkelsen » Fri Sep 11, 2020 2:09 pm

I'm using the database module of Switch to update an Access database, which works just fine. However, the database has a boolean field (a checkbox). Any idea what would be the sql statement to toggle that field?

UPDATE Webshop (Produktionsklar)
VALUES ('????')

jan_suhr
Advanced member
Posts: 379
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: SQL statement to update boolean field

Post by jan_suhr » Fri Sep 11, 2020 3:33 pm

Have you checked what's in the database field in the database.

Could it be True or False or maybe 1 or 0
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps

User avatar
Terkelsen
Advanced member
Posts: 252
Joined: Thu Sep 08, 2011 5:08 pm
Contact:

Re: SQL statement to update boolean field

Post by Terkelsen » Wed Sep 16, 2020 10:19 am

Hi Jan,

Sorry for my late response.

These were my first thought too, but none of them seems to work.

jan_suhr
Advanced member
Posts: 379
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: SQL statement to update boolean field

Post by jan_suhr » Wed Sep 16, 2020 10:28 am

Do you have any kind of database editor that you can access the Db directly and read what it says on that field?
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps

User avatar
Terkelsen
Advanced member
Posts: 252
Joined: Thu Sep 08, 2011 5:08 pm
Contact:

Re: SQL statement to update boolean field

Post by Terkelsen » Fri Sep 18, 2020 11:31 am

Well, it turned out that 0 and 1 indeed were the triggers to use, so I finally got this statement to turn the check box on:

UPDATE Webshop
SET Produktionsklar=1
WHERE OrdreID='[Metadata.Text:Path="/Impleo_JobTransaction/TopOrderID",Dataset="Xml",Model="XML"]'

jan_suhr
Advanced member
Posts: 379
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: SQL statement to update boolean field

Post by jan_suhr » Fri Sep 18, 2020 11:33 am

Great
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps

Post Reply