Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

problem with datetime format from ms sql

this is part of my script:

Calendar:

LOAD

DATEE as dtime,

Month(DATEE) AS Month,

num(Month(DATEE)) AS 'Monthn',

Day(DATEE) AS 'DDay',

Year(DATEE) AS 'YYear',

'K' & Ceil(Month(DATEE)/3) AS 'Quart'

resident TCalendar;

drop table TCalendar;

// Just a calendar

//

pos:

load po,code,

name as po_name,

date(floor(deliverytime)) as dtime, 

sup_name,firstday,lastday,slday,received,

po_mat,po_cont;

 

sql select pp.po,pp.code,pp.name ,pp.deliverytime  // in MS SQL Server 2008 - datetime, values 2011.08.29 12:34 e.g.

then, when my script executed I see some strange numbers in dtime field I expect date, but see number

what's wrong with this?

Labels (1)
2 Replies
Not applicable
Author

You might need to replace the '.' with a '/'

date(replace(text(DATEE),'.','/'))

Not applicable
Author

you'll need to wrap your sql with TO_DATE I think

so

TO_DATE(pp.deliverytime) As deliverytime

hope that helps

thanks

Joe