How to add a integer field to date field in maximo? - date

I need to add a integer field to the date field then output value should be in date format.
For Eg: frequency is integer field and certdate is date field i wrote a Set Value action in which I need to set the summation of both values to the Nextdate field(Date) and i am using db2.

If having a Value of :certdate + :frequency and a Parameter/Attribute of NEXTDATE isn't working for you, you'll need to revert to an automation script or Java class that uses the Date and Calendar classes to do what you want.

Related

Crystal Reports: using date from the datatime field as a parameter

I am working on a report that I need to add a date range parameter. The field that I need to use in the datetime field, and I need to use the date portion from the field. I tried using the following, but the report returns no result.
cast(StartDateTime as date) between {?StartDate} and {?EndDate}
For the time being, I am using the Select Expert to sort the date range, but I have to manually enter the date in 'yyyy-mm-dd' format. Is there a way to set up the parameter, so that I can use the calendar to choose the dates?
I recommend to use one parameter field and set it to range and date instead of two.
With this you can use easily this formula:
{StartDateTime} = {?Parameter}
If you set the Parameter to Date instead of DateTime it will automatically check with the start of the day for the first range and the end of the day for the last range.

How to convert a specific text string to today's date in Power BI

I have a table with a column called that contains text. Most of the values are years. However, some have the value "present" to represent groups that are still currently active. I want to convert those values to today's year, and convert the column type to date (specifically year type). I want to avoid creating a new column if possible.
Please see below for the DAX language that worked.
= Table.ReplaceValue(#"Extracted Year2",null,DateTime.LocalNow() ,Replacer.ReplaceValue,{"Disbanded"})

How to add 13min's time in Time Field(not date time field) Crystal reports

I tried using Dateadd('n',13,{fieldname}).
but it throws an error not a valid date time field cause it is time field.
is there any way to convert it to datetime and add the value and revert it into time field?
Thanks.
Try this formula:
DateAdd('n',13,DateTime(CurrentDate, {fieldname}))
The DateTime(date, time) function will create a DateTime value that works in the DateAdd() function. This will only work if the {fieldname} is a Time data type though.
If {fieldname} is a string, you will need to convert it to a Time data type first using the Time(time) function.
The formula I suggested above will append your time value to today's date. You will then need to format the DateTime value it returns to only display the time value. This can be done by right clicking the field in your crystal report and clicking Format Field and setting the Style on the Date and Time tab.

DateTime in Hyperledger

I want to enter the participant's Date of Birth as input when i go to Test tab and click + Create New Participant (JSON file).
But if I use the DateTime datatype as given in github documentation for Hyperledger Composer Modeling Language, the current date and time is auto inserted which I don't want. How can I do it?
either you set it to a base epoch (yyyy-mm-dd) as a suggested format eg.
o DateTime datefield default="1970-01-01" or
o DateTime datefield default="1900-01-01"
or you just set it to nothing by using optional eg.
o DateTime datefield optional
then (in data entry) you can supply the right yyyy-mm-dd (DoB) format only, as you wish in Playground 'Test' - it will set the remainder attributes for (T)ime as zeros and supply the right DateTime format.
cheers

Casting date in Talend Data Integration

In a data flow from one table to another, I would like to cast a date.
The date leaves the source table as a string in this format: "2009-01-05 00:00:00:000 + 01:00".
I tried to convert this to a date using a tConvertType, but that is not allowed apparently.
My second option is to cast this string to a date using a formula in a tMap component.
At the moment I tried these formulas:
- TalendDate.formatDate("yyyy-MM-dd",row3.rafw_dz_begi);
- TalendDate.formatDate("yyyy-MM-dd HH:mm:ss",row3.rafw_dz_begi);
- return TalendDate.formatDate("yyyy-MM-dd HH:mm:ss",row3.rafw_dz_begi);
None of these worked. When inserting the result into the target-table (MySQL, InnoDB) a receive the error message that the date is not valid. The format of the target field is a MySQL Date field.
How can I cast the date to the desired format?
Talend offers you a nice way of handling date formats.
You can easily change the date format in the Schema editor tab at the tMap window.
It works for both tMap input and output flows.
I've added a picture for a better illustration.
to cast this string to a date using a formula.... error message that
the date is not valid. The format of the target field is a MySQL Date
field.
What I understand from your question is, you want to insert a date into MySQL Date field.
But the method that you are using, returns the 'String' type.
TalendDate.formatDate(String pattern, Date date); //formats a date into Date/Time string
So in that case, if your field is of 'Date' type.
TalendDate.parseDate("yyyy-MM-dd", TalendDate.formatDate("yyyy-MM-dd",row3.rafw_dz_begi));