0

Date comparison with DateDiff

Currently the date comparison of two dates can only be done with one format “yyyy-MM-dd HH:mm:ss”, but to work with another one the DateDiff function does not work correctly. This is a problem because we use German format. It would be important for us if this case could be considered.

4 replies

null
    • samuel_alma
    • 5 mths ago
    • Reported - view

    This is not correct. The text representation of a date is not how the datediff function operates. What matters is that its an actual date. Your first job, if you have your dates as text/string, is to convert them into actual date-time values. Look at the StringtoDateTime function. If you need to do this with Granular functions in custom columns, you cannot use this function, so it may be harder to do. But the principle still applies.

      • imbarmarinescubar_pyram
      • 5 mths ago
      • Reported - view


      Pyramid does have a ToDate function for building custom columns.
      It's visible as a Casting Block in the Logic app, but seems to be missing from the list in script mode.

      You can simply type "ToDate([table].[str date col])" and the data source will cast the string into Date. If the DB is also configured to German language I believe this would work out-of-the-box. If not, you might need to fix the text values using text functions (such as substring and concat) to get to the yyyy-MM-dd format, as you mentioned.

      • Daniel_Jaldin
      • 5 mths ago
      • Reported - view

       Thank you for your answer! I will try to use this function.

      • Daniel_Jaldin
      • 5 mths ago
      • Reported - view

       thank you for your suggestion, I will analyze it.

Content aside

  • Status Answered
  • 5 mths agoLast active
  • 4Replies
  • 44Views
  • 3 Following