Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

i have a value lets say its: 24544 I obtain this information from data set to populate the value of one of my columns. i want to display it in my report as:

  1. W: 2
  2. D: 3
  3. H: 1
  4. M: 4

i've tried =Format(DateAdd("n", Fields!Downtime.Value, "00:00:00"), "wk:dd:HH:mm") but it does not accept ww or wk and exceeds number of days above 7 (which should increase the counter of weeks instead). I work in VS 2010 How can i achive this?

question from:https://stackoverflow.com/questions/65885673/ssrs-get-number-of-weeks-days-hours-and-minutes-from-an-int-representing-timespa

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.1k views
Welcome To Ask or Share your Answers For Others

1 Answer

You can try these expressions in your placeholders.

W: =FLOOR(Fields!Downtime.Value/10080)

D: =FLOOR((Fields!Downtime.Value - (FLOOR(Fields!Downtime.Value/10080))*10080)/1440)

H:=FLOOR((Fields!Downtime.Value - ((FLOOR((Fields!Downtime.Value/10080))*10080)+ (FLOOR((Fields!Downtime.Value - (FLOOR(Fields!Downtime.Value/10080))*10080)/1440))*1440))/60)

M:=Fields!Downtime.Value - (((FLOOR(Fields!Downtime.Value/10080)*10080)+ (FLOOR((Fields!Downtime.Value - (FLOOR(Fields!Downtime.Value/10080))*10080)/1440))*1440)+ (FLOOR((Fields!Downtime.Value - ((FLOOR((Fields!Downtime.Value/10080))*10080)+(FLOOR((Fields!Downtime.Value - (FLOOR(Fields!Downtime.Value/10080))*10080)/1440))*1440))/60)*60))


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...