Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Date

Hi

I have in the DB "Datetime" this is "dd.MM.YYYY mm.hh". Like this "12.08.2013 10:45". How can I load just the date "12.08.2013"?

Tags (2)
1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Re: Date


This?

LoadedTable:

Load *,

          Date(Floor(Date#(DATETIME, 'DD.MM.YYYY mm.hh.fff'))) As Date ;

       

ODBC CONNECT TO [xxx](xxx,xxx)

SQL SELECT Id,

                    action,

                    DATETIME

                

FROM XX."XX";

And if this too not working, try simply:

Date(Floor(DATETIME)) As Date

View solution in original post

14 Replies
Highlighted
MVP
MVP

Re: Date

Hi

This should do it:

Date(Floor(Date#(DateTimeField, 'DD.MM.YYYY mm.hh'))) As Date

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Highlighted
Partner
Partner

Re: Date

Hi,

Can you try this:

 

= date(datefield,'DD.MM.YYYY')

Highlighted
MVP
MVP

Re: Date

Hi

Be careful. Date() does not discard the time values, it simply formats the date time field to not display the time part. Use Floor() to truncate the date time field to get rid of the time portion.

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Highlighted
Not applicable

Re: Date

I saw its more than "12.08.2013 10:45". It's "12.08.2013 10:45:10.000000000"

Highlighted
Not applicable

Re: Date

like:

Select id,

          name,

          =date(datefield,'DD.MM.YYYY')

FROM table;

or how do I use the "="?

Highlighted
Master II
Master II

Re: Date

tRY THIS IN TEXT OBJECT

=SubField('12.08.2013 10:45.10000000000000',' ',1)

You 'll got the Date

or in script you can do this way

load

id,

  name,

subfield(datefield,' ',1) as Date

FROM table;

Highlighted
Not applicable

Re: Date

I tried your expressions but i didnt get it working

Highlighted
MVP
MVP

Re: Date

Have you tried using floor() function, as suggested by Jonathan Dienst  ? That should work fine. If all above not working, please share a sample file.

Highlighted
Not applicable

Re: Date

My Code:

ODBC CONNECT TO [xxx](xxx,xxx)

SQL SELECT Id,

                    action,

                    DATETIME     //Sample: 12.08.2013 14:30:30.000000000

                    Date(Floor(Date#(DATETIME, 'DD.MM.YYYY mm.hh'))) As Date

FROM XX."XX";

Then I got an error.

Script Error....     Ausdruck fehlt

Scripr Error....      Expression wrong