Previous Thread
Next Thread
Print Thread
Joined: Sep 2001
Posts: 1,028
Adagio Maestro
Adagio Maestro
Joined: Sep 2001
Posts: 1,028
I am trying to create a string that returns the date as follows:

March 31, 2006 with comparative figures for 2005

Presently I can get everything except the year 2005. I only know how to get 2006 to show up. The formula I have in at this point is:

=DATESTRING(ADGETF("gldates.END",FPRIOR(0)),"%B %d, %Y with comparative figures for %Y")

I know the %Y is wrong, but what do I need to do to get the prior year (that is 2005).


Thanks,

Ken Aberdeen,CPA, CMA
Aberdeen Business Consulting Ltd.
ken@aberdeenconsulting.ca
Joined: Mar 1999
Posts: 11,746
Adagio Action Team
Adagio Action Team
Joined: Mar 1999
Posts: 11,746
Hi Ken,

The DateString function is simply to apply formatting to a particular date, such as Mar 31, 2006 in your case. If you want to include the prior year 2005 with your text, you have to calculate it.

The function to take the year from a date is YEARL, and subtract 1 from the result. You then have to convert this number to a string to include it with the rest of the text. The formula to do this is:
=STRING(YEARL(ADGET("gldates.END",FPRIOR(0)))-1,0)

So to add to the rest of what you previous posted, a formula to get what you want is:
=DATESTRING(ADGET("gldates.END",FPRIOR(0)),"%b %d %Y with comparative to ") & STRING(YEARL(ADGET("gldates.END",FPRIOR(0)))-1,0)
-----
An alternate way to get a date 12 fiscal periods prior to the one selected from the toolbar is to change the function parameter from 0 to 12:
=ADGET("gldates.END",FPRIOR(12))

This would give a second way to get the year:
=STRING(YEARL(ADGET("gldates.END",FPRIOR(12))),0)


Regards,
Softrak Tech Support

Moderated by  Softrak Support 

Link Copied to Clipboard
Who's Online Now
0 members (), 71 guests, and 3 robots.
Key: Admin, Global Mod, Mod
Forum Statistics
Forums5
Topics14,679
Posts71,625
Members1,874
Most Online1,408
Dec 9th, 2025
November
S M T W T F S
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Powered by UBB.threads™ PHP Forum Software 8.0.0