I need to take the maximum value of a date field in the Content view. Not a problem using the functions. However, the result contains also a time value whilst the timevalue does not exist in the table. Seems a bit strange.
Alle - dates and times are stored internally by computers as large integer numbers of miliseconds. Depending on their source, if the values are converted to dates from text the values may have assumed dates and months, and often when HH:mm:ss are unspecified in the value these are appended as 00:00:00. When you format date/time fields in Omniscope, you specify how much of the date/time value is displayed and how. In this case, the Table View is applying formatting which does not display the HH:mm:ss whereas the Content View is not. Go to Data > Manage Fields and re-format the display of the field without the HH:mm:ss. If it still displays in the Content View, report this as a bug.
create field MaxDate: DATETOTEXT(SUBSET_MAX([Date])) create field MaxDataDate: LEFT([MaxDate],(LEN([MaxDate])-8)) the 8 is for the time characters + the space.
In stead of using the Search function to search for the position of the space between the date and the time, I took the LEN as the Search function returns only nulls and I can't figure out why. I used SEARCH([MaxDate]," "). Doesn't work even though MaxDate is a text field.
Function DATETOTEXT changes the date format. Example: I have a field that is called Today and is populated by the formula 'NOW'. I set the date format to MMM-dd-YYYY. When I use DATETOTEXT([TODAY]), the date format is reset to dd-MMM-YYYY.
Can you please advise how I can set the date to a format I require? Thanks
Arjan - the DATETOTEXT function has an optional argument to specify the custom display format for the resulting date, including the time zone value e.g. GMT+1:00
DATETOTEXT([DateValue],MMM-dd-yyyy,optional time zone value)
If you do not specify, or use an invalid format such as upper case YYYY, the default date format will be used. Note that Omniscope/Java date/time formatting strings are case-sensitive...MM is months...mm is minutes...HH is 24-hour display; hh is 12-hour display etc. etc.