Setting boolean fields with SQL statements

Setting boolean fields with SQL statements

Post by Tales Normand » Thu, 01 Feb 2001 02:28:26



Hi,

            Is it possible to set boolean fields with SQL statements like
INSERT INTO or UPDATE? If so, what should I consider?

Tales Normando

 
 
 

Setting boolean fields with SQL statements

Post by Dan Artus » Fri, 02 Feb 2001 03:46:25


Hi Tales,
Here is an example (for Access)

INSERT INTO tblTest ( MyBool )
Values(-1);

Inserts True.
HTH
Dan


Quote:> Hi,

>             Is it possible to set boolean fields with SQL statements like
> INSERT INTO or UPDATE? If so, what should I consider?

> Tales Normando


 
 
 

1. Setting boolean field from date field values...

I'm using SQL Server 2000 and trying to set a boolean column, CurrentDay,
in a table, MyStatus, to true for a certain date (i.e. 1/28/2003).

If I run the code below, the boolean values are reversed:
-=-=-=-=
        UPDATE
                MyStatus
        SET
                CurrentDay = DateDiff(day, PriceDate, '1/3/2002')
-=-=-=-=

If I run the code below, I get an error at the == sign.  How should I do
this?
-=-=-=-=
        UPDATE
                MyStatus
        SET
                CurrentDay = (DateDiff(day, PriceDate, '1/3/2002') == 0)
-=-=-=-=

Thanks for any help you can give me...

Hugh
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

In order to reply via email, please remove the no_spam_for_me_ before
my real email address.

2. How to handle correction?

3. set a field that stores a boolean (true/false)

4. Performance and SQL Agent

5. Add field with Boolean field type failed using ADOX

6. Sybase Partner Needed

7. BDE, dBASE, SQL, and Logical fields (boolean)

8. Is there an annual Informix Developers Conference?

9. Help! SQL and BOOLEAN field

10. Boolean field in SQL-Anywhere

11. if statement within if boolean expression

12. Boolean type in SELECT statement

13. Execute a SQL Server 7.0 SET (T-SQL) statement