I have a view I'm creating that is somewhat of a summary view. The Bit
field it has no problem displaying as a checkbox, that's the way I have it
defined in the Table. However, what about displaying Checkboxes for other
fields? For example, I have a field called LastAction. If the LastAction
field is Not Null I want the checkbox to be checked, if it IS Null, I want
the checkbox unchecked. Here's the portion of my T-SQL statement that
pertains to this "LastAction" field:
CASE WHEN LastAction IS NULL
THEN 0 ELSE 1 END AS Actions
Now this displays 0 or 1 depending on whether the Actions field contains
data. Is there anyway to make it display a checkbox instead (Checked for 1,
Unchecked for 0)
Thanks,
Ryan
Tom Ellison - 29 Jan 2006 00:36 GMT
Dear Ryan:
How about:
CBool(LastAction IS NOT NULL)
A column must be explicitly boolean to display with a check box.
Tom Ellison
>I have a view I'm creating that is somewhat of a summary view. The Bit
>field it has no problem displaying as a checkbox, that's the way I have it
[quoted text clipped - 13 lines]
> Thanks,
> Ryan
Ryan Langton - 30 Jan 2006 16:44 GMT
What about this tells it to display as a check box though? Won't it still
display as a 1 or 0?
> Dear Ryan:
>
[quoted text clipped - 23 lines]
>> Thanks,
>> Ryan
Sylvain Lafontaine - 29 Jan 2006 03:12 GMT
You can try to convert the result to a Bit field using the Convert() or the
Cast() functions on the result of the Case statement.

Signature
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF
>I have a view I'm creating that is somewhat of a summary view. The Bit
>field it has no problem displaying as a checkbox, that's the way I have it
[quoted text clipped - 13 lines]
> Thanks,
> Ryan
Ryan Langton - 30 Jan 2006 16:47 GMT
I tried CAST( <CASE STATEMENT> AS BIT) AS Actions
Now it displays as either True or False. Is there any way to tell it to use
a checkbox?
Thanks,
Ryan
> You can try to convert the result to a Bit field using the Convert() or
> the Cast() functions on the result of the Case statement.
[quoted text clipped - 16 lines]
>> Thanks,
>> Ryan