Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

I want to seprate date and time from a column

Hello all,

The problem here is I have a colum which is displaying data as

msg_rcpt_log

10-03-2013 10:21
17-07-2015 18:40
20-07-2015 17:30
20-07-2015 21:49
20-07-2015 21:57

Now I want to get the dates only so that whenever I click on that date I can get the analytics for that.

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

To remove the time portion, you must use Floor and NOT just formatting functions. Formatting functions can hide the display of time, but the underlying value still contains the time portion.

To get the time only, use Frac().

IMHO string mangling is unnecessary as QV/QS are well equipped with date functions.

Date(Floor(myDate))

Time(Frac(myDate))

If the date/time is not recognised, then use the recognition functions:

Date(Floor(TimeStamp#(myDate, 'YYYY-MM-DD hh:mm')))

Time(Frac(TimeStamp#(myDate, 'YYYY-MM-DD hh:mm')))


Also, see:

Why don’t my dates work?


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

View solution in original post

10 Replies
Not applicable
Author

LOAD * INLINE [

    time

   

10-03-2013 10:21







17-07-2015 18:40







20-07-2015 17:30







20-07-2015 21:49







20-07-2015 21:57



  

]
;



load SubField(time,'-',1) as day

Resident date;



Not applicable
Author

dates are many I have just gave few for example, So do I  have to Load all the date??

no special command so that time gets a cut off from there?

sushil353
Master II
Master II

Hi,

Try this:

Time(Date#(DateField,'MM-DD-YYYY hh:mm')) as Time

Date(Date#(DateField,'MM-DD-YYYY hh:mm')) as Date

HTH

sushil

sasiparupudi1
Master III
Master III

try

trim(SubField(yourdateField,' ',1)) as MyDate

Not applicable
Author


date:

LOAD * INLINE [

    time
10-03-2013 10:21

17-07-2015 18:40
20-07-2015 17:30
20-07-2015 21:49
20-07-2015 21:57

]
;



//load SubField(time,'-',1) as day,

load date(timestamp#(time,'DD-MM-YYYY hh:mm'),'DD') as day1

Resident date;



Not applicable
Author

Not getting any of it I hav 500 rows in that column how can I use inline with this many rows any simple way to go

jonathandienst
Partner - Champion III
Partner - Champion III

To remove the time portion, you must use Floor and NOT just formatting functions. Formatting functions can hide the display of time, but the underlying value still contains the time portion.

To get the time only, use Frac().

IMHO string mangling is unnecessary as QV/QS are well equipped with date functions.

Date(Floor(myDate))

Time(Frac(myDate))

If the date/time is not recognised, then use the recognition functions:

Date(Floor(TimeStamp#(myDate, 'YYYY-MM-DD hh:mm')))

Time(Frac(TimeStamp#(myDate, 'YYYY-MM-DD hh:mm')))


Also, see:

Why don’t my dates work?


Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
sasiparupudi1
Master III
Master III

Post your application so that we can understand better what the issue is and advise you accordingly

Not applicable
Author

Thank you so very much and ya thank you all for giving me solutions XOXO

Regards,

Cyrus .:)