• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Changing datagrid display

LEGEND ,
Oct 01, 2006 Oct 01, 2006

Copy link to clipboard

Copied

I have a web site when the designed can either 'hide' a project so it can
only be view in house by the design team or set it 'live' so the client can
view it. I have it set to 1 (live) or 0 (hidden)
I have a datagrid to display all the projects created and I would like to
show if the project is live or not, but it shows either the 1 or 0. I would
like it to show 'yes' or 'no'. How can I set a conditional to say 'if 1 then
yes else no' and have that display? I tried to set a variable first that
does the conditional evaluation, but the grid column will not recognize it.

--
Wally Kolcz
Developer / Support


TOPICS
Advanced techniques

Views

260

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 01, 2006 Oct 01, 2006

Copy link to clipboard

Copied

I would think it would be best to do it in the query. Depending on which
database server you are using I would think you should be able to do
something in the select statement.


"Wally Kolcz" <wkolcz@projectproofing.com> wrote in message
news:efp0jn$fbh$1@forums.macromedia.com...
>I have a web site when the designed can either 'hide' a project so it can
>only be view in house by the design team or set it 'live' so the client can
>view it. I have it set to 1 (live) or 0 (hidden)
> I have a datagrid to display all the projects created and I would like to
> show if the project is live or not, but it shows either the 1 or 0. I
> would like it to show 'yes' or 'no'. How can I set a conditional to say
> 'if 1 then yes else no' and have that display? I tried to set a variable
> first that does the conditional evaluation, but the grid column will not
> recognize it.
>
> --
> Wally Kolcz
> Developer / Support
>


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 01, 2006 Oct 01, 2006

Copy link to clipboard

Copied

I am using MySQL, but don't know how to do that in the query.

SELECT P.project_id, P.title, P.live, P.projstatus, P.date, C.company
FROM project P LEFT OUTER JOIN client C ON P.client = C.username
WHERE P.dirname='#arguments.username#'


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 01, 2006 Oct 01, 2006

Copy link to clipboard

Copied

I am not sure exsacaly but I think something like this might work. You may
need to referance the MySQL docs.

SELECT P.project_id, P.title, P.projstatus, P.date, C.company,
Case When P.live = 1 Then 'Yes'
When P.live = 0 Then 'No' End as live
FROM project P LEFT OUTER JOIN client C ON P.client = C.username
WHERE P.dirname='#arguments.username#'


"Wally Kolcz" <wkolcz@projectproofing.com> wrote in message
news:efp204$goc$1@forums.macromedia.com...
>I am using MySQL, but don't know how to do that in the query.
>
> SELECT P.project_id, P.title, P.live, P.projstatus, P.date, C.company
> FROM project P LEFT OUTER JOIN client C ON P.client = C.username
> WHERE P.dirname='#arguments.username#'
>


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 01, 2006 Oct 01, 2006

Copy link to clipboard

Copied

Wow, that worked. Thanks.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 01, 2006 Oct 01, 2006

Copy link to clipboard

Copied

LATEST
you can also try
SELECT P.project_id, P.title, P.projstatus, P.date, C.company, IF(P.live = 1, 'yes', 'no')
FROM project P LEFT OUTER JOIN client C ON P.client = C.username
WHERE P.dirname='#arguments.username#'

haven't tried this either, but technically should work...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation