Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Need help with cdatetime formula & datediff formula

I need some help writing formulas:

1) I have

a) Evaluating date 10/21/09

b) Evaluating time 03:18PM

c) Monitoring date 10/21/09

d) Monitoring time 03:21PM

How would I write my formula using cdatetime to combine evaluating date plus evaluating time? (e)

I would also neeed to write a formula to combine monitoring date plus monitoring time as well. (f)

2) I would also need to write a formula to get the number of hours different between (evaluating date + evaluating time) and

(monitoring date + monitoring time) using datediff?

Thanks in advance for your help.

T

2)

Former Member
Former Member replied

Well you have a couple of options...

1) You can calculate a a date using the "CurrentDateTime"

2) You could calculate a default date using the the "Evaluating date"

3) Set it to "0"

1)

IF IsNull({MonitorDate}) THEN CurrentDateTime ELSE {MonitorDate}

2) this example adds a default 24hrs to the eval datetime if the monitor dt is null

IF IsNull({MonitorDate}) THEN DateAdd("h", 24, {EvalDate}) ELSE {MonitorDate}

3)

IF IsNull({MonitorDate}) THEN {EvalDate} ELSE {MonitorDate}

Basically, it just depends on what you want the result to be...

HTH,

Jason

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question