Skip to main content
Announcements
YOUR OPINION MATTERS! Please take the Qlik Experience survey you received via email. Survey ends June 14.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Setting a date format and using the date the calculate how long it's been since the date in the data

I have a dates that equal

 

6/24/2013 0:00

How do I define that this data is datetime format?

How do I find out what today is? Today()?

6 Replies
aarkay29
Specialist
Specialist

Date#(Field,'MM/DD/YYYY') to define and interpret that it's a date field in specified format.

yes today() to return present day.

piotrtk
Contributor II
Contributor II

Hi,

You need to use Date and Date# functions. Also, use script command 'SET DateFormat = .....' to setup right date format you want to use.

Example code will generate value '2017-06-24' in variable vDate:

//---------------

SET DateFormat='YYYY-MM-DD';

LET vDate = date(date#('6/24/2017', 'MM/DD/YYYY'))

//--------------

You are right - Today() function returns current date.

Regards,

Piotr

Not applicable
Author

Try this ..

FRAC(date#(6/24/2013 0:00,'MM/DD/YYYY')) 

and today() function will return today date

sumitjadhav
Creator II
Creator II

Please Provide a Dummy Data

tcullinane
Creator II
Creator II

today()-floor(date#([DateField],'MM/DD/YYYY hh:mm'))

will give the number of days in the difference

muthukumar77
Partner - Creator III
Partner - Creator III

Hi,

Today data is Today().

Date#(Floor(Field),'MM/DD/YYYY hh:mm')

Muthukumar Pandiyan