Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k 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 Reply

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...