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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula with date number 2

Status
Not open for further replies.

wld1957

Technical User
Feb 3, 2006
68
US
CRXI - I have been trying to create a formula to do the following. I want the formula to look at a number in a field and then times it by 365, then divide it by the current date. There is a number associated with each day of the year. ie: 01-01-2008 = 1, 01-02-2008 = 2 and so on. I just do not know how to make the formula look at the current date and tell it to use the number for that day. Any help would be greatly appreciated. Thanks in advance.

numeric.field/365 * (current date-must be nubmer for that day)
 
YOu will need to add 1 to that as this would make 1st Jan 2008 as day zero.

Ian
 
Thanks so much for the help. It works great and it saves me a lot of time.
 
There is also a SQL expression function that may be available to you:

{fn dayofyear(table.`date`)}

Go to field explorer->SQL expression and see if it is in your functions list under date.

-LB

 
Thanks for the additional information, I did not realize there were different options under sql in this manner. This also works well. I will have to explore it further. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top