Visokio website     Downloads     Video tutorials     KnowledgeBase  
Maximum Date field - Visokio Forums
Maximum Date field
  •     Mees January 25, 2011 4:02PM
    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.
  • 6 Comments
  •     tjbate January 26, 2011 1:23AM
    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.
  •     steve January 26, 2011 2:01AM
    Actually, this might be a glitch. Can you post your file here so we can test?

    You can workaround by using a formula DATETOTEXT(..., "dd-MMM-yyyy") or similar, where "..." is your existing formula.
  •     Mees February 1, 2011 9:03AM
    steve, thanks for your help
    This is what I did:

    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.
  •     Mees February 4, 2011 8:37AM
    Still a question on this...

    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
  •     tjbate February 4, 2011 9:00AM
    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.

    Please consult:
    http://www.visokio.com/dates-and-times
  •     Mees February 4, 2011 4:06PM
    thanks thomas. this works perfectly

Welcome!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership