423,682 Members | 1,352 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,682 IT Pros & Developers. It's quick & easy.

Months Depreciation Greater than 15 days

P: 20
If date acquired is greater than 15 days, I want to exclude that month using the below expression

E.g. If on 16/1/2018 an asset was put to use, the monthly depreciation will start February rather than January since the asset was put to use above 15 days of January:

I have this expression which I want to incorporate that please help.
Expand|Select|Wrap|Line Numbers
  1. MonthsDeprec: IIf(DateDiff("m",[DateAcquired],[Forms]![form2]![txtenddate])+1<=[lifeTime],DateDiff("m",[dateacquired],[forms]![form2]![txtenddate])+1,[lifetime])
Sep 13 '18 #1

✓ answered by Seth Schrock

The following will calculate the starting date for your DateDiff.
Expand|Select|Wrap|Line Numbers
  1. StartDate: IIF(Day(DateAcquired) < 16
  2.             , DateAcquired
  3.             , DateSerial(
  4.                     Year(DateAdd("m", 1, DateAcquired))
  5.                     , Month(DateAdd("m", 1, DateAcquired))
  6.                     , 1
  7.                     )
  8.             )
  9.  

Share this Question
Share on Google+
7 Replies


Seth Schrock
Expert 2.5K+
P: 2,907
Am I correct in assuming that your example of 16/1/2018 would be the value in [DateAcquired]? If so, then are you wanting your DateDiff() function to use 1/2/2018 instead of DateAcquired?
Sep 13 '18 #2

NeoPa
Expert Mod 15k+
P: 31,084
Please post the question in meaningful English. We shouldn't (According to site rules.) be put in a position where we have to work out what the question should be from some gobbledegook expression simply because you won't make the effort to ask your own question properly.

We're happy to help, but we expect a little more than a simple minute of work to prepare the question properly. If you're happy to get involved then we are too. If not then I don't believe it's reasonable to expect us to be.
Sep 13 '18 #3

P: 20
Seth Schrock Yes and if at all the dateAcquired is less than 15/1/2018 then the DateDiff function to use DateAcquired.
Sep 14 '18 #4

P: 20
NeoPa. I have some challenges in English because it is not my motherís language I learn it, and also my background is Accounting may be that is why you did not understood my question, you have to bear with me for that.

In accounting practice if an was purchase and put to use Greater than 15th of the Month, the monthly depreciation will star the following month, and if at all the asset was put to use less than 15th of the month the monthly depreciation will start that very month.

What I want to my DateDiff function to do is to include any asset with DateAcquired Less than 15th of the month and exclude above 15th of the month. I donít know if u understand me now. Thanks
Sep 14 '18 #5

Seth Schrock
Expert 2.5K+
P: 2,907
The following will calculate the starting date for your DateDiff.
Expand|Select|Wrap|Line Numbers
  1. StartDate: IIF(Day(DateAcquired) < 16
  2.             , DateAcquired
  3.             , DateSerial(
  4.                     Year(DateAdd("m", 1, DateAcquired))
  5.                     , Month(DateAdd("m", 1, DateAcquired))
  6.                     , 1
  7.                     )
  8.             )
  9.  
Sep 14 '18 #6

NeoPa
Expert Mod 15k+
P: 31,084
Mafi:
NeoPa. I have some challenges in English because it is not my motherís language I learn it
That's fair enough then Mafi. I can understand it's a little more difficult when working in a foreign language.

Let us know if Seth's suggestions help.
Sep 14 '18 #7

P: 20
Nice one, it works as i want thank you very much Seth Schrock.

NeoPa Am glad that u understand and my problem is solved, thanks
Sep 17 '18 #8

Post your reply

Sign in to post your reply or Sign up for a free account.