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

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

reporting services - SSRS get number of weeks days hours and minutes from an int representing timespan in minutes

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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))


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...