Skip to Content
0

I'm trying to represent days of the week as a string

Feb 15, 2017 at 04:01 PM

44

avatar image
Former Member

I'm trying to represent days of the week as a string. However in the example above if {rental.mon_qty}=1 it puts MO but it does don't put all of the other abbreviations that have a 1.

Here is my formula:

if{rental.sun_qty}=1 then "SU " else

if{rental.mon_qty}=1 then "MO " else

if{rental.tue_qty}=1 then "TU " else

if{rental.wed_qty}=1 then "WE " else

if{rental.thu_qty}=1 then "TH " else

if{rental.fri_qty}=1 then "FR " else

if{rental.sat_qty}=1 then "SA "

days.png (15.6 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
avatar image
Former Member Feb 19, 2017 at 08:56 AM
0

Hello,

Please try this code

Local Stringvar Days;
if {rental.sun_qty} = 1 then
Days :=  '(SU)';
if {rental.mon_qty} = 1 then
Days :=Days + '(MO)'; if {rental.tue_qty} = 1 then Days := Days + '(TU)'; if {rental.wed_qty} = 1 then Days := Days + '(WE)'; if {rental.thu_qty} = 1 then Days := Days + '(TH)'; if {rental.fri_qty} = 1 then
Days := Days + '(FR)'; if {rental.sat_qty} = 1 then Days := Days + '(SA)'; Days

Thanks,

Engr. Taseeb Saeed

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Feb 19, 2017 at 08:30 AM
0

Hello,

What is your required output in days column, for example in first row you have 0 for SUN and 1 for rest.

What you want to see in days column ? MO,TU,WE,TH,FR,SA ? like this? please explain.

Regards,

Engr. Taseeb Saeed

Share
10 |10000 characters needed characters left characters exceeded