I have a field, SortOrder, that is an integer field that will be (0,1,2,3,4,
etc).
I want to display it as (A,B,C,D,E, etc)
Using something like:
select SortOrder from skillsAnswers
Is there a way to make 0 an "A", 1 a "B", etc in a select statement?
Thanks,
Tom.If the numbers are limited, you can use CASE. Alternatively you can add the
ASCII values if these are strictly alphabets.
Perhaps, you can explain what requires you to attempt something like this
and someone here might offer a better suggestion.
Anith|||"Anith Sen" <anith@.bizdatasolutions.com> wrote in message
news:%23rf68NlAFHA.1564@.TK2MSFTNGP09.phx.gbl...
> If the numbers are limited, you can use CASE. Alternatively you can add
> the ASCII values if these are strictly alphabets.
> Perhaps, you can explain what requires you to attempt something like this
> and someone here might offer a better suggestion.
What I am doing is setting up some Question and Answers scenarios in which I
could be changing the order of the display. The order is going to
determined by the field SortOrder. As I add a new answer, the SortOrder is
incremented by 1. The order can be changed later by just changing the
values of these fields (but they always will be in order sequentually
0,1,2... with not missing numbers).
I want to display the answers the way you normally display questions and
answers as "A,B,C..."
Thanks,
Tom
> --
> Anith
>|||>> The order can be changed later by just changing the values of these
Perhaps I may be missing the big picture here, but why not use a CHAR(1)
column instead of an INTEGER?
Anith|||"Anith Sen" <anith@.bizdatasolutions.com> wrote in message
news:ORtCvXlAFHA.2640@.TK2MSFTNGP14.phx.gbl...
> Perhaps I may be missing the big picture here, but why not use a CHAR(1)
> column instead of an INTEGER?
It would be a 6 of one type of solution. I am using the SortOrder as the
index into a bit pattern. I am setting bits in a work to tell me what the
person picked (0 will set the first bit, 1 the 2nd etc).
I did end up doing sort of what you suggested, which works fine,
SELECT SortOrder=char(Sortorder+65),Answer,
Thanks,
Tom.
> --
> Anith
>
Showing posts with label integer. Show all posts
Showing posts with label integer. Show all posts
Wednesday, March 7, 2012
Displaying Char from an integer field
Saturday, February 25, 2012
DisplayGroupTree Format?
Hi, I have a report in which I have created a group. The grou field is an integer in the database. I could format the groupname field on the report to display it without any decimals.
However, when I bind the report to a viewer on windows form, the displaygrouptree diplays the group name with decimals. For ex:, the report displays 2000 and the displaygrouptree displays it as 2000.00 How can I make the displaygrouptree to display it as 2000?
Any suggestions are greatly appreciated.
Thanks.You could use a formula to convert it to a string and group on the formula.
e.g.
totext({table.field}, 0, '')
However, when I bind the report to a viewer on windows form, the displaygrouptree diplays the group name with decimals. For ex:, the report displays 2000 and the displaygrouptree displays it as 2000.00 How can I make the displaygrouptree to display it as 2000?
Any suggestions are greatly appreciated.
Thanks.You could use a formula to convert it to a string and group on the formula.
e.g.
totext({table.field}, 0, '')
Tuesday, February 14, 2012
Display dropdown parameter label on report
I have a dropdown parameter in my report (Sites) with the ID field as a
integer and the display field as a string. How can I display the selected
'display' field on the report? I can display the ID (int) ok with
= Parameters!SiteID.Value
But how can I get the actual selected dropdown text? Can't find this
anywhere!
cheers,
SimonYou can try:
= Parameters!SiteID.Label
"Anonymous Poster" wrote:
> I have a dropdown parameter in my report (Sites) with the ID field as a
> integer and the display field as a string. How can I display the selected
> 'display' field on the report? I can display the ID (int) ok with
> = Parameters!SiteID.Value
> But how can I get the actual selected dropdown text? Can't find this
> anywhere!
> cheers,
> Simon
>
>|||Excellent! Thanks
Simon
"Andre" <Andre@.discussions.microsoft.com> wrote in message
news:CE5FD740-6859-4830-AA02-76C8C97AED34@.microsoft.com...
> You can try:
> = Parameters!SiteID.Label
>
> "Anonymous Poster" wrote:
> > I have a dropdown parameter in my report (Sites) with the ID field as a
> > integer and the display field as a string. How can I display the
selected
> > 'display' field on the report? I can display the ID (int) ok with
> >
> > = Parameters!SiteID.Value
> >
> > But how can I get the actual selected dropdown text? Can't find this
> > anywhere!
> >
> > cheers,
> >
> > Simon
> >
> >
> >
integer and the display field as a string. How can I display the selected
'display' field on the report? I can display the ID (int) ok with
= Parameters!SiteID.Value
But how can I get the actual selected dropdown text? Can't find this
anywhere!
cheers,
SimonYou can try:
= Parameters!SiteID.Label
"Anonymous Poster" wrote:
> I have a dropdown parameter in my report (Sites) with the ID field as a
> integer and the display field as a string. How can I display the selected
> 'display' field on the report? I can display the ID (int) ok with
> = Parameters!SiteID.Value
> But how can I get the actual selected dropdown text? Can't find this
> anywhere!
> cheers,
> Simon
>
>|||Excellent! Thanks
Simon
"Andre" <Andre@.discussions.microsoft.com> wrote in message
news:CE5FD740-6859-4830-AA02-76C8C97AED34@.microsoft.com...
> You can try:
> = Parameters!SiteID.Label
>
> "Anonymous Poster" wrote:
> > I have a dropdown parameter in my report (Sites) with the ID field as a
> > integer and the display field as a string. How can I display the
selected
> > 'display' field on the report? I can display the ID (int) ok with
> >
> > = Parameters!SiteID.Value
> >
> > But how can I get the actual selected dropdown text? Can't find this
> > anywhere!
> >
> > cheers,
> >
> > Simon
> >
> >
> >
Subscribe to:
Posts (Atom)