Man Utd
3/28/2007 12:01:00 AM
As my situation is a bit complicated:
My application needs to support 2 databases: MS Access and SQL Server.
So I need to use the same database structure in both databases.
If the field I defined as number (ie. integer) in MS Access and SQL Server,
then I need to CAST the field to BIT in SQL statement.
How do I do that to make compatible to MS Access and SQL Server syntax?
"Looch" <lucianoj2005@yahoo.com> wrote in message
news:1175006939.931095.162880@p15g2000hsd.googlegroups.com...
> On Mar 27, 3:28 am, "Alan T" <alanpltseNOS...@yahoo.com.au> wrote:
>> I am an application programmer using a front end component which has a
>> property link to a Boolean field of a dataset.
>> It is fine when I connect the MS Access, as MS Access has field type
>> Yes/No.
>>
>> However, for SQL 2000 it has no data type of Boolean or Logical or
>> Yes/No.
>> How do I return the field as boolean by:
>> SELECT if field1 value is 1 then true else false end
>> something like that ?
>
> VB.NET 2005 has a ToString() function that I used in a similar
> situation which converted the value (Output param from select
> statement) to either "True" or "False" and adjusted the code
> accordingly.
>