Re: Converting yes or no to one letter strings.

2019-06-05 Thread Christopher Browne
On Tue, 4 Jun 2019 at 18:30, Lou wrote: > Hi everyone, > > Is it possible to convert a boolean yes or no field to hold a one letter > string? For example, the strings: 's' 'f' 'p' 'e' > > To start off, I just need to convert true to 's'. false will have to be > manually changed to 'f' or 'p' or '

Re: Converting yes or no to one letter strings.

2019-06-05 Thread Adrian Klaver
On 6/4/19 7:27 PM, Ron wrote: On 6/4/19 7:19 PM, Adrian Klaver wrote: On 6/4/19 3:29 PM, Lou wrote: Hi everyone, Is it possible to convert a boolean yes or no field to hold a one letter string? For example, the strings: 's' 'f' 'p' 'e' To start off, I just need to convert true to 's'. fal

Re: Converting yes or no to one letter strings.

2019-06-04 Thread Ron
On 6/4/19 7:19 PM, Adrian Klaver wrote: On 6/4/19 3:29 PM, Lou wrote: Hi everyone, Is it possible to convert a boolean yes or no field to hold a one letter string? For example, the strings: 's' 'f' 'p' 'e' To start off, I just need to convert true to 's'. false will have to be manually c

Re: Converting yes or no to one letter strings.

2019-06-04 Thread Adrian Klaver
On 6/4/19 3:29 PM, Lou wrote: Hi everyone, Is it possible to convert a boolean yes or no field to hold a one letter string? For example, the strings: 's' 'f' 'p' 'e' To start off, I just need to convert true to 's'. false will have to be manually changed to 'f' or 'p' or 'e' as appropriate.

Re: Converting yes or no to one letter strings.

2019-06-04 Thread Rich Shepard
On Tue, 4 Jun 2019, David G. Johnston wrote: Actually, given that "f" is becoming multiple different values it seems like the OP is improving upon their data model. That should very much be done at the table level at not relegated to views, let alone a UI layer. It is not unusual to want to con

Re: Converting yes or no to one letter strings.

2019-06-04 Thread David G. Johnston
On Tue, Jun 4, 2019 at 4:01 PM Rich Shepard wrote: > On Tue, 4 Jun 2019, Lou wrote: > > > To start off, I just need to convert true to 's'. false will have to be > > manually changed to 'f' or 'p' or 'e' as appropriate. > > Second, if you need to display to the user something other than 't' and '

Re: Converting yes or no to one letter strings.

2019-06-04 Thread David G. Johnston
On Tue, Jun 4, 2019 at 3:30 PM Lou wrote: > Is it possible to convert a boolean yes or no field to hold a one letter > string? For example, the strings: 's' 'f' 'p' 'e' > Something like the following should work: ALTER TABLE ... ALTER COLUMN ... TYPE text USING (CASE WHEN ... THEN 's' ELSE 'f' E

Re: Converting yes or no to one letter strings.

2019-06-04 Thread Ray O'Donnell
On 4 June 2019 23:30:33 Lou wrote: Hi everyone, Is it possible to convert a boolean yes or no field to hold a one letter string? For example, the strings: 's' 'f' 'p' 'e' To start off, I just need to convert true to 's'. false will have to be manually changed to 'f' or 'p' or 'e' as appropri

Re: Converting yes or no to one letter strings.

2019-06-04 Thread Rich Shepard
On Tue, 4 Jun 2019, Lou wrote: To start off, I just need to convert true to 's'. false will have to be manually changed to 'f' or 'p' or 'e' as appropriate. Lou, I'm far from an expert so take my comments with a bag of salt. First, 'false' is displayed in a column as 'f' when you look at a ta