How to Select and display latest date (openCobol) - cobol

Im new to Cobol.
A column of Date need to identify the latest date to be display.
8/9/2004
2/7/2016
24/04/1995
27/09/2016
And it able to identify 27/09/2016 as the latest date

I found my Answer at last.
Compare date: if Billdate (latest date), move to report date
IF WSAA-BillDate > WSAA-ReportDate
MOVE WSAA-BillDate to WSAA-ReportDate
END-IF

Related

How to fix date formats in Delphi 10.4 CE

I'm facing date format problems in Delphi 10.4 CE.
If the date fields are created in SQL server with DateTime format, and a date field is incremented in the application with a specific number of days using the System.DateUtils.IncDay() function while the source date is 01/10/2022, I get the result as 01/09/1900 in the DBEdit component and in DBGrid when incremented by 10 days.
However, if I recreate date fields with formatting as Date fields (and not DateTime), the increment function shows errors like:
'' is not a valid date and time
Moreover, if I skip the increment function and add a record to the SQL table, the dates are shown in the format dd/mm/yyyy, but after adding records once, if I close the session and restart the application, all dates show up in the format yyyy-mm-dd.
Following is the source code to calculate the incremented date:
tblLeaveAzr.FieldByName('leaveend').AsDateTime := IncDay(tblLeaveAzr.FieldByName('leavestart').AsDateTime,tblLeaveAzr.FieldByName('leavedays').AsInteger);
I have been working in Delphi 6, 7 and 2009 for more than 20 years, but never faced such a problem.

Get beginning of the day by given date in Swift

I have an todo application and some tasks have deadlines. If deadline is bigger or equal than current date, I want to display them. However, there is a local datetime problem i believe.
This is the current date using 'print(Date())':
2021-07-27 18:53:03 +0000
This is the beginning of that date using 'print(Calendar.current.startOfDay(for: Date()))':
2021-07-26 21:00:00 +0000
As you see, 27th day becomes 26th. I tried timezone operations also. It seems true but day is still starting at 21.00
When I convert them as string and print them, it is ok it show the expected results but without string type it becomes like above. Because of I want to get the bigger or equal days compared to current date , string solution is not working. It is the 27th of day but because of date object it is shown as 26th day and my app showing yesterdays tasks etc.
Can you provide a help for me?
Thanks

Google Sheets: IF and Date formula not working

I'm calculating annual holiday accrual.
All holiday resets at the start of the calendar year.
If a staff member started after 01.01.2017 they will have a lower holiday entitlement for the year.
I'm trying to create a formula which says:
If this cell's date is after 01.01.2017 return that cells date. Otherwise, set it at 01.01.2017.
(so basically, I don't care when they started if it was before 01 Jan 2017 because all my following calculations will be based off the first day of the year)
Here it is:
=if(T21<date(1,1,2017),T21,"01/01/2017")
No matter what is in the cell, it is returning 01/01/2017.If I change the < to > it returns cell T21 in all cases.
Any ideas?
Thanks
You have the DATE() values mixed up. Try:
=if(T21<date(2017,1,1),T21,"01/01/2017")
DATE() is year, month, day
Also, you may want to use DATEVALUE() on the FALSE value to force the returned item to a date:
=if(T21<date(2017,1,1),T21,DATEVALUE("01/01/2017"))
"01.01.2017" is not a valid date in Google docs. You need to change . to /.
=DATEVALUE(SUBSTITUTE(T21,".","/"))
=IF(DATEVALUE(SUBSTITUTE(T21,".","/"))<DATEVALUE(date(2017,1,1)),T21,"01/01/2017")

Roll-Forward Date Patterns in Excel

Using Excel 2010, I need to take an existing date in 2015 (i.e. 2/11/15), and calculate the same date position in the next year. In other words, whatever is the specific date pattern with the existing date, I'm looking for a formula that will help me calculate the exact same date pattern. If 2/11/15 is the second Wednesday in February of 2015, I need a formula to help me calculate (using the existing date) the second Wednesday of February in 2016.
#Jeeped, thanks for your reply. You're correct - there's many "conditions" to account for. Two colleagues helped-out with the following:
=IF('Data (Reference)'!C14>"", CONCATENATE(TEXT('Data (Reference)'!C14, "MM"),"/", TEXT(7-(WEEKDAY(CONCATENATE(TEXT('Data (Reference)'!C14,"MM"),"/", Input!$C$2))-1)-7+TEXT(WEEKDAY('Data (Reference)'!C14), "DD")+(CEILING(TEXT('Data (Reference)'!C14, "DD")/7, 1)-(IF(TEXT(WEEKDAY('Data (Reference)'!C14), "DD")
We had to consider wherever the existing date fell, and dynamically identify the pattern and/or condition and re-apply it in the roll-forward sequence.

It is possible to change or disable Date validator in jira

I change calendar javascript to Hijri, But another problem comes up. It seems that a class (DueDateValidator.class) try to validate input date, while the number of days in month is different to georgian calendar. for example we have 31 days in second month of year but in georgian (february) it is 28 or 29.
I don't think there is an out-of-the-box option to cancel Jira's date validation. You could overwrite Jira's date validation, but I think it will be easier to use a Free Text Field custom field that will hold the date as a string. Then, add to the field js code that will hide this field and copy it's date to the date field.
To keep the right order when searching for issues, you can either use date mapping to keep the georgian calendar up to date, or store the dates in a sortable way (for example YYYY/MM/DD/HH/MM - 201302161334) and order the results according to this field.
UPDATE
Simple example for Jira version 5.2.6, this will copy the text from field id customfield_10001 to the created field:
AJS.$("#create-date").text(AJS.$("#customfield_10001-val").text().trim())
To search easily keep another text field and save the date in the following format :
year month day hour minute
All in digits. for example, today's Gregorian date would be:
2013 02 267 10 26
than, when searching for issues, for example to find issues created after today's date:
custom_filed > "2013 02 267 10 26"
that sorting will work since it will sort issues first by year, than month, day, hour, minute.
I stored date in text field by creating new custom field in system-customfieldtypes-plugin.xml filed but In search it only accept exact text not > or <
custom_filed ~ "2013 02 267 10 26" It is acceptable but
custom_filed > "2013 02 267 10 26" shows jQL error.

Resources