# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Valued Contributor II

## How to compute the number of day from 2 date ?

Hi All

I have below 2 expression :-

Date(Date#([Opportunities Expected Close Date],'MM-DD-YYYY'),'MMM-YYYY') as [YearMth_EC],

Date(Date#([Opportunities Created Time],'MM-DD-YYYY hh:mm:ss'),'MMM-YYYY') as [YearMth_CT],

I need to compute the number of day duration for the above 2 date in number of day :-

sum(

Date(Date#([Opportunities Expected Close Date],'MM-DD-YYYY'),'MMM-YYYY') as [YearMth_EC],

-

Date(Date#([Opportunities Created Time],'MM-DD-YYYY hh:mm:ss'),'MMM-YYYY') as [YearMth_CT],

)

It does not work as above.

CAn some one advise me.

Paul

1 Solution

Accepted Solutions
MVP

4 Replies
MVP

## Re: How to compute the number of day from 2 date ?

Valued Contributor II

## Re: How to compute the number of day from 2 date ?

Hi Anil

Interval( YearMth_EC-YearMth_CT, 'D' )

Thank you very much for the link. it work fine.

Paul

MVP

## Re: How to compute the number of day from 2 date ?

NP, But, I would suggest you to surf by your end before creating the thread. Then only you came to know what functionalities can usable in future for each requirement. Because, I've seen you since 2016-April. Still you are looking basics (Sorry if it hurts) - But good to endorse from my end for basic functionalities.

And this case YearMth_EC - YearMth_CT will work

Valued Contributor II

## Re: How to compute the number of day from 2 date ?

Hi Anil

Thank you very much for your strong word.

I will try to read the manual in future before asking.

Paul