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: 
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?

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