Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Convert timestamp string to num in text box

hi,

I have a string 2015-05-26 12:34:38, how can I find its numeric value ?

I tried

=num(Timestamp

           (

             Timestamp#(2015-05-26 12:34:38,'YYYY-MM-DD HH:MM:SS')

                                                                    ,'YYYY-MM-DD HH:MM:SS'

             )

)

doesnt not work

1 Solution

Accepted Solutions
swarup_malli
Specialist
Specialist

Try using this in the test box

=num('2015-05-26 12:34:38')

View solution in original post

4 Replies
swarup_malli
Specialist
Specialist

Try using this in the test box

=num('2015-05-26 12:34:38')

sunny_talwar

Try this with single quotes around your time when you are using it by typing it out:

=Num(Timestamp#('2015-05-26 12:34:38', 'YYYY-MM-DD HH:MM:SS'))

When using a fieldname you can do this:

=Num(Timestamp#(FieldName, 'YYYY-MM-DD HH:MM:SS'))

swuehl
MVP
MVP

Please note that format code 'MM' denotes month, not minutes:

=Num(Timestamp#('2015-05-26 12:34:38', 'YYYY-MM-DD hh:mm:ss'))

Without testing, I think Swarup's expression will also work as long as QV recognizes the string matching it with it's default timestamp format. Stating a explicite format code like above should work anyway.

sunny_talwar

You are right, my bad Stefan. Correct Expressions should be:

=Num(Timestamp#('2015-05-26 12:34:38', 'YYYY-MM-DD hh:mm:ss'))

=Num(Timestamp#(FieldName, 'YYYY-MM-DD hh:mm:ss'))