3

トゥールを含むレポートを作成しています。tour_start_time データフィールドが入力された 1 つの列と、tour_end_time が入力された別の列があります。次に、合計時間という列があります。[Total Time] 列には、hh:mm 形式で tour_start_time と tour_end_time の違いを示す必要があります。したがって、tour_start_time が 5:00 を返し、tour_end_time が 5:06 を返した場合、合計時間は 0:06 になります。これと、私が使用しているものではないすべての参照パラメーターを読んだ DateDiff のものを取得できないようです。テーブル内のデータが必要です。私はこの表現を試しました: =DateDiff(minute,Fields!tour_start_time,Fields!tour_end_time)

しかし、それは機能せず、私が試したバリアントも機能しませんでした。私はこれに慣れていないので、何かが足りないことを知っています。それがばかげた質問である場合は申し訳ありませんが、それを説明できる人、または少なくとも試してみる別の機能を提供してくれる人が必要です。

4

1 に答える 1

14

Assuming your columns are actually DateTime data types, your DateDiff expression should look like this:

=DateDiff(DateInterval.Minute, Fields!tour_start_time.Value, Fields!tour_end_time.Value)

or

=DateDiff("n", Fields!tour_start_time.Value, Fields!tour_end_time.Value)

VB.NET DateDiff requires a DateInterval parameter; you can either specify the enumerator member (DateInterval.Minute) or its string representation (i.e. "n" for minute).

This will only return an integer value for the difference in minutes; it sounds like you need to then change this to a HH:mm string. Off the top of my head the easiest way to do this would be with some custom code in the report which takes this integer value as a parameter and construct the string based on this. Let me know if you need more information for this part.

于 2013-06-19T08:54:55.477 に答える