Get last day of the next three months with Crystal Report - crystal-reports

I am heading to find out a formula for a date that is the last day of the next 3 months with Crystal Report. I've tried with the code as below but it shows a message when it is out of an array of month (1-12). Please give me any advice to address this problem.
ToText(date(year({rptIEXSaleInvoiceSummary.ETD}),month({rptIEXSaleInvoiceSummary.ETD})+4,1)-1, "dd-MMM-yyyy")
It works fine if the ETD's month is less than 8. However, it might cause problem when it is more than 9, 10 as an image below.

I've found the solution. Please let me know if you have any idea to solve the problem.
IF (month({rptIEXSaleInvoiceSummary.ETD})+4) > 12 THEN
ToText(date(year({rptIEXSaleInvoiceSummary.ETD})+1,month({rptIEXSaleInvoiceSummary.ETD})-8,1)-1, "dd-MMM-yyyy")
ELSE
ToText(date(year({rptIEXSaleInvoiceSummary.ETD}),month({rptIEXSaleInvoiceSummary.ETD})+4,1)-1, "dd-MMM-yyyy")

To get the 4th month use DateAdd
DateAdd(“m”,4,{rptIEXSaleInvoiceSummary.ETD})
Then you can compose the date
ToText(date(year(DateAdd(“m”,4,{rptIEXSaleInvoiceSummary.ETD})),month({rptIEXSaleInvoiceSummary.ETD}),1), "dd-MMM-yyyy")
or subtract days
DateAdd(“d”,day({rptIEXSaleInvoiceSummary.ETD}), DateAdd(“m”,4,{rptIEXSaleInvoiceSummary.ETD}))

Related

I want to write a formula in Google Sheets that counts the appearance of a value in a range, but the range is the result of another formula

I'm trying to count the number of times "Tuesday" (or any day of the week) appears in a range. However, my range is another formula, that is, the "Tuesday" is the result of a formula from another cell where I have put in the date.
For example, in B1, I have put in "2019.09.17." Thus, A1 will show, "Tuesday" because I set A1 to show the day of the week that corresponds to the date in B1.
If it matters, my formula in A1 is just "=B1" and then I changed the "Format>Number" to display just the day of the week.
My actual range is A1:A10.
I've tried =countif(A1:A10,"Tuesday"), but the result returns 0. I've also tried =countif(B1:B10,"Monday") to try and use the range from the "original" input, but the result is still 0.
Sorry if this question has been asked elsewhere and I'll be more than happy to rescind my question and read the answer elsewhere if someone could just direct me to it because I'm also actually not sure how to search for what I'm asking.
To get the "day of the week" you can use the following formula:
=TEXT(B1,"ddddd")
and then count normally "
Hope this helps!
Sidney
try like this:
=ARRAYFORMULA(COUNTIF(TO_TEXT(A1:A10), A12))

Google Sheets, 8 digit number to date format

I am using Google Sheets to import a list of names and dates from a comma delimited text file. It imports fine but when I try to convert the date cells I get strange results. The dates are 8 digits long and arranged "year, month, day". for example, i have this date. 20170425 when I format it to any of the date formats I get 57124-09-13.
I've tried everything I can think of and searched forever for an answer.
Thanks so much in advance to anyone who can steer me in the right direction!
Since you've added an Excel tag, use Data, Text to Columns, Fixed Width, Next, Date: YMD, Finish.
For google-sheets, use this formula in an unused column,
=DATEVALUE(replace(replace(A1, 7, 0, "/"), 5, 0, "/"))

Handsontable datepicker week number modification

Hello i am using the Handsontable library and i have a problem.
I cant find anyway to configure the date Picker to start counting after the first Thursday of the year.
As a result i get a week more than i should.
I get week 27 instead of week 26 for 29-06-2016.
Anyone has a suggestion?
You will use the ISO 8601 format. In Pickaday you have to set the option "showWeekNumber" to "true". The default is "false"

adding todays date mid sentence and return mm/dd/yyyy (manually not vba)

Not sure if I can post this here as it is not through a vba macro. I been searching but can't seem to find a solution on here or google. I have a sentence in lets say A1 that I want to say:
*Productivity is based on past 4 weeks to today (7/27/2015 - 8/26/2015)
What I want to do is make it so I never have to change today's date "8/26/2015". I tried to to use & and looks like this
="*Productivity is based on past 4 weeks to today (7/27/2015 - " & TODAY() & ")"
problem is it returns as *Productivity is based on past 4 weeks to today (7/27/2015 - 42242)
How can I make 42242 return as a short date mm/dd/yyyy?
And is it even possible to make to make a formula for 7/27/2015 to go back 4 weeks to the monday of that week?
Try the TEXT function:
="*Productivity is based on past 4 weeks to today (7/27/2015 - " & TEXT(TODAY(),"mm/dd/yyyy") & ")"
To go back four weeks (28 days) from today (alas, does not guarantee a particular day of week):
="Four weeks ago is " & TEXT(DATE(YEAR(TODAY()), MONTH(TODAY()),DAY(TODAY())-28),"mm/dd/yyyy")
Have not tested this extensively, but I believe this will get you back to the Monday of the week four weeks previous:
="Monday of week four weeks previous: " & TEXT(DATE(Year(today()),month(today()),day(today())-28-mod(today(),7)+2),"mm/dd/yyyy")
The trick above is to use the MOD function to get an index into the current day of week, then offset that back to Monday...

Editing the year in date field in EXTJS 4.0 is defaulting the year to 2020

I have a date field in a form
xtype: 'datefield',
id: 'dateId',
maskRe: /[0-9\/]/,
format : 'm/d/Y',
for ex - if the date populated in that field is 07/30/2014. now i want to manually edit the date, if i give two backspaces, which means 07/30/20. and then click some where in the form, the year is getting defaulted to 07/30/2020. how to stop this getting defaulted to that 2020 year.
I answered this in my comment, but I will try to expand on that comment as much as possible, and make it as clear as possible. Here is the original comment:
"07/30/20 is equivalent to 07/30/2020. This is expected and normal behavior. When a year is only two digits, it is always the last two digits, so 20 == 2020, 00 == 2000, 14 == 2014, etc."
So, let me step you through an example.
You type 08/08/2014 into the datefield.
Hit backspace twice, removing the 1 and the 4.
Now you have 08/08/20.
When writing dates, the year can be written as 2 digits or 4. If written as two, the last two digits are used. So, the year 20 is the same as the year 2020.
The datefield has logic to handle 2 digit dates, so it knows that 08/08/20 is actually 08/08/2020.
That is why when you have 08/08/20 in a datefield, it interprets it as 08/08/2020.