Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
pauldamen
Partner - Creator II
Partner - Creator II

Only load date and not time from date/time field

Hi,

I am trying to load a date from a database into Qlikview. The field I am taking the data from is a date/time field so the data looks like: 28-12-2012 12:07:31

When I am trying to make a master calender it keeps runing because of the time field and therefor making a endless amount of fields.

I have tried to load the data with a left function, date function, in a variable but none seems to be working.

Hope someone can help me with only loading the date and forgetting the whole time field.

Regards,

Paul

1 Solution

Accepted Solutions
Gysbert_Wassenaar

If you must do it in the sql statement then try: DATEADD(dd, DATEDIFF(dd, 0, cm_viewdate), 0)

Otherwise I'd try to use floor(cm_viewdate) in the load statement.


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Not applicable

date(date#(date1-timestamp#('hh:mm:ss'),'dd/mm/yyyy))

hope it helps you

jagan
Luminary Alumni
Luminary Alumni

HI,

Try like this

=Date(Date#('28-12-2012 12:07:31', 'DD-MM-YYYY hh:mm:ss'), 'DD-MM-YYYY')

Hope this helps you.

Regards,

Jagan.

pauldamen
Partner - Creator II
Partner - Creator II
Author

I tried the date function as well, the script part looks like this:

SQL

SELECT "cm_parent_webpageid", "cm_parent_webpageidname",

    "cm_referringdomain", "cm_trafficsourcename", "cm_viewdate"

FROM "Finext_CRM".dbo."Filteredcm_webpageview";

When I put the cm_viedate (this is the date part) in this formula and reload I get a error saying: ErrorSource: Microsoft OLE DB Provider for SQL Server, ErrorMsg: 'Date' is not a recognized built-in function name.

Why do I get this message?

Regards,

Paul

Gysbert_Wassenaar

If you must do it in the sql statement then try: DATEADD(dd, DATEDIFF(dd, 0, cm_viewdate), 0)

Otherwise I'd try to use floor(cm_viewdate) in the load statement.


talk is cheap, supply exceeds demand