Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date formula question

Status
Not open for further replies.

natetc

Technical User
Nov 4, 2010
21
CA
Hi all,

My question is how do I create a date/time formula that runs for the current/yesterdays business day. I want the formula to pick up data from yesterday 3pm to today 3pm. This is the formula I have in the system now:

{ABC.EVENT_DATTIM} in DateTime (2010, 10, 27, 15, 00, 00) to DateTime (2010, 10, 28, 15, 00, 00)

So the goal is to have "2010, 10, 27" to change, first date is yesterday and second date is today.

Any thoughts?
Thanks!
 


Yesterday 3:00:

dateadd("h",15,currentdate - 1)

Today 3:00:

dateadd("h",15,currentdate)

However, if you're using a range you should probably subtract a minute from the today calculation:

dateadd("n",899,currentdate)

gives you today at 2:59 pm.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top