Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

MatBlack
New Contributor II

Datetime to just Date

Hello,

I'm very new to QV so please bear with me.

I have a datetime datatype coming in from an SQL table.

In the QV straight table it shows as dd-mm-yyyy; as I've used Date(floor(mydate)dd-mm-yyyy).... etc - So far so good.

When I export that table to excel or when I run my nprint task the date is coming in as a String.

How can I get just the dd-mm-yyyy to show in my export and nprint and have it as a date-type?

As I need to do further date related queries on it in an excel setting.

Thanks.

1 Solution

Accepted Solutions
MatBlack
New Contributor II

Re: Datetime to just Date

What I ended up doing to get a Date datatype being output was:

 

LOAD ProjectID,
Date((Min (BenefitTargetDate)),'DD/MM/YYYY') as [BTargetDate]
GROUP By ProjectID;

SQL SELECT ProjectID,
BenefitTargetDate
FROM xxx.dbo.ProjectDetails;

5 Replies
mikaelsc
Contributor III

Re: Datetime to just Date

where are you doing the formatting? (script or table?) 

also check if "keep source formatting" in nprinting solves your pb. 

MatBlack
New Contributor II

Re: Datetime to just Date

Thanks for the reply.

The dashboard I'm working on was not originally created by me.

There is alot of formatting going on in the script.

My current attempt (Date(Floor())) is done on the table.

The remaining conditional formatting is currently done on the nprint template.

I'll have a look for that "keep source formatting" when I'm in the office in the morning.

has75042
New Contributor III

Re: Datetime to just Date

I had the same issue. 

This is what I did

=Date(CalendarLink, 'MM/DD/YYYY')

=date(Date(CalendarLink)) 

 

It worked for me

MatBlack
New Contributor II

Re: Datetime to just Date

Please forgive the basic question as I'm sort of learning on the job here, but...
I would on the Dimension in question in the table?
MatBlack
New Contributor II

Re: Datetime to just Date

What I ended up doing to get a Date datatype being output was:

 

LOAD ProjectID,
Date((Min (BenefitTargetDate)),'DD/MM/YYYY') as [BTargetDate]
GROUP By ProjectID;

SQL SELECT ProjectID,
BenefitTargetDate
FROM xxx.dbo.ProjectDetails;