Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Finding difference between date and time.

Hi

I have these two fields with data in the particular format as shown below, I've tried Interval to get the difference between the "PO_CREATION" and "PO_FIRST_SUBMISSION" dates but to no avail. It would be great if somebody can help me out.Thanks.

ProcurementCreation.PNGProcurementSubmit.PNG

2 Replies
Anonymous
Not applicable
Author

Hi nicholas !!

That question is not new in all about Database , kind of that Question about "What is better to use Data or Data time" are already bigs forums like Stackoverflow

mysql - What is the best data type for DATE and TIME - Stack Overflow

c# - Date vs DateTime - Stack Overflow

If we listen Oracle "The datetime datatypes are DATE, TIMESTAMP, TIMESTAMP WITH TIME ZONE, and TIMESTAMP WITH LOCAL TIME ZONE. Values of datetime datatypes are sometimes called datetimes."

so if your qiuestion is , Why i see the same with both different kind of Data Type : The answer should be , casuse they are not at all differente kind of Data Type in fact "Time" is the Extension of  Date.

TIMESTAMP Datatype

The TIMESTAMP datatype is an extension of the DATE datatype. It stores year, month, day, hour, minute, and second values. It also stores fractional seconds, which are not stored by the DATE datatype.

So time allow you more precision, but bassically if you want to store DD/MM/YYYY HH:MM you can do in both format.

Enrique

sunny_talwar

It seems that neither of the two timestamp fields are interpreted as timestamp by QlikView. You need to use TimeStamp#() function to help QlikView understand your date.

TimeStamp(TimeStamp#(PO_CREATION, 'DD-MMM-YYYY h:mm')) as PO_CREATION,

TimeStamp(TimeStamp#(PO_FIRST_SUBMISSION, 'DD-MMM-YYYY h:mm')) as PO_FIRST_SUBMISSION

Now you will have these two dates as date and time field in QlikView and you can use Interval function to do your calculations.

Read here for more on this topic:

Why don’t my dates work?

Get the Dates Right