Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date format

Hi all,

I have a Date field ENTRY_DATE coming from database in the format of 1,110,105 i.e CYYMMDD

i.e 1-C, 11-YY (2011), 01-MM(Jan), 05-DD

I want to show them as YYYY-MM-DD 

Using Date(Right(ENTRY_DATE,6)) i could achieve 110105..but the Dates are not correct.

Any suggestions?

Thanks in advance

1 Solution

Accepted Solutions
Not applicable
Author

I got it.

Timestamp(Date(Date#(Right(ENTRY_DATE,6),'YYMMDD'),'YYYY-MM-DD hh:mm:ss AM')) as ENTRY_TIMESTAMP

Closing the thread.

Thanks.

View solution in original post

9 Replies
PrashantSangle

Hi

Use Date(Date#(Right(ENTRY_DATE,6),'YYMMDD'),'YYYY-MM-DD')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
MK_QSL
MVP
MVP

Date(Date#(Right(ENTRY_DATE,5),'YYMMDD'),'YYYY-MM-DD') as ENTRY_DATE

Not applicable
Author

Thanks for the quick reply.

Any idea about Timestamp format with always TT as AM? Like below

Timestamp(Timestamp#(Right(ENTRY_DATE,5),'YYMMDD'),'YYYY-MM-DD hh:mm:ss TT') as ENTRY_DATE?


??

PrashantSangle


Hi,

When you use

this expression

Timestamp(Timestamp#(Right(ENTRY_DATE,5),'YYMMDD'),'YYYY-MM-DD hh:mm:ss TT')

But your Right(ENTRY_DATE,5) giving only YYMMDD formated date then

Timestamp() consider other parameter like "hh:mm:ss " as "00:00:00"

and according to 00 hour, 00 min and 00 sec your TT as 'AM'.

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
MK_QSL
MVP
MVP

=TimeStamp(TimeStamp#(Date(Date#(Right(ENTRY_DATE,6),'YYMMDD')) & ' 00:00:00'),'YYYY-MM-DD hh:mm:ss TT')

Not applicable
Author

Hi Dude try this

Date(Date#(Right(date,7),'YYM,MDD'),'YY-MM-DD') as date1 Resident table;

and please close the thread

Not applicable
Author

This is another Timestamp field. where i want them as AM always no matter when you run the script.

Not sure why the Timestamp format is showing as A9 instead of AM for TT..

Rest are fine though..

Thanks.

Not applicable
Author

hi Gtripathy i think what u have selected as correct answer is not giving the exact answer what ur expecting , please try my example and compare the results

Not applicable
Author

I got it.

Timestamp(Date(Date#(Right(ENTRY_DATE,6),'YYMMDD'),'YYYY-MM-DD hh:mm:ss AM')) as ENTRY_TIMESTAMP

Closing the thread.

Thanks.