Is there an equivalent QV function that truncates the seconds part from a timestamp ?
In Oracle, I'll do something like this - TRUNC(sysdate, 'MI') .
For instance, date today is 06/01/2010 04:58:45 PM, the function above returns as 06/01/2010 04:58:00 PM.
I tried the timestamp() function but this will only affect the column display not the value stored in QV. I need the seconds stored as 00 as I am using this for calculation.
Yes, but it doesn't actually truncate to minutes. It only changes the display. That means that 15 seconds past the minute and 45 seconds past the minute will be maintained as two separate values, not the same value. Now in some cases, changing the display may be good enough. In others, such as in Anthony's case, as he stated explicitly, it won't be. See attached, where a list box for the display-only version shows the "same" value twice, which almost certainly isn't what you'd want.
This might be a very basic question, however how would you truncate the date and time field to display just minutes in the application? I tried using timestamp and few other functions, but no luck .
Thanks in advance.
To display just minutes, don't include seconds or fractions of a second in the format:
To actually remove the seconds from the underlying data, there would be multiple approaches. Here's one:
Or did you really mean just minutes, and not hours or the date either?