Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Function Problem


Recommended Posts

Firstly please ignore my last thread on the forum, i couldn't delete it, but the problem has changed slightly.


My issue is that i have a Check-In date and a Check-Out date and i need to work out the number of days between so that i can multiply the result by the cost. (its a room reservation database)


i have found this custom function on the net but its not working...https://www.briandunning.com/cf/1012


Is there a simpler way of achieving this?


Hope you can help,



Link to comment
Share on other sites

Are these two fields that are in the same record? If so just subtract CheckIn Date from CheckOut date. No custom function needed! Calculation field, result type number. Result is in days.


Hope you don't have dashes (aka minus signs, we use them as hyphens when typing text) in your field named like "Check-In Date"... those are illegal...

Link to comment
Share on other sites

Thank you so much, i've spent a few hours this morning playing with custom functions. It took 10 seconds with your advice.


Have to remember that there is always an easy way!!


Thanks again!!!!!!

Link to comment
Share on other sites

Well that was a short but valued high...


now i have another issue, very simple but i don't now the anwer.


I need a calculation: SubTotal = Days * Cost


If the cost field is in the same table as the Days field then the calculation works. If (and it is) the cost field is in a related table, then the calculation doesn't work.


I don't understand why! any ideas??

Link to comment
Share on other sites

Yes - it does not know which cost field to use. I assume it is a one to many relationship, and there is the potential to be many records that relate, each potentially with a different cost. How is the program to figure out which one to use?

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

Terms of Use