cancel
Showing results for 
Search instead for 
Did you mean: 

Formatting Time Field in Visual Composer Model

Former Member
0 Kudos

Hi Gurus,

As a complete newbie to VC, I'm hoping someone can help me with this very basic question.

How would I extract the hours/mins from a field containing the following: u201C00:00:00u201D

I think this might work but haven't had a chance to test (systems down): TGET(@TIME,u2019Hu2019)&u2019:u2019& TGET(@TIME,u2019Mu2019)

Can anyone help?

Thanks,

Bim.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

>

> Hi Gurus,

>

> As a complete newbie to VC, I'm hoping someone can help me with this very basic question.

>

> How would I extract the hours/mins from a field containing the following: u201C00:00:00u201D

>

> I think this might work but haven't had a chance to test (systems down): TGET(@TIME,u2019Hu2019)&u2019:u2019& TGET(@TIME,u2019Mu2019)

>

> Can anyone help?

>

> Thanks,

>

> Bim.

Hi

You can also try following expression -

MID(@Time,0,2)&":"&(@Time,3,2)

You will get required value in 'HH:MM' format.

Regards

Sandeep

Former Member
0 Kudos

Hi Sandeep,

Just tried your suggestion (MID(@Time,0,2)&":"&(@Time,3,2)) and the VC model comes up with the error:

"Too many arguments for function".

Could you elaborate a little further?

Thanks,

Bim.

Answers (1)

Answers (1)

Former Member
0 Kudos

Bim,

That should be ok, i guess. If your time is for eg "9:05:10" your formula will give you 9:05.

Hope that is what you are looking for.

Rgds

Former Member
0 Kudos

Hi Vineeth,

My formula only shows me a ":".

The field I am pulling the data from says it is a text field, may be a silly question but could that be why it can't see the data?

Thanks,

Bim.

Former Member
0 Kudos

Hi

There is little modification in formula required -

MID(@Time,0,2)&":"&MID(@Time,3,2) bracket is not required before 'MID'.

Also you need to right this formula in 'Connecting Line' after the input form or table.

Regards

Sandeep

Former Member
0 Kudos

Hi Sandeep,

Thanks again for a quick response.

You mentioned a connection line, my model has a Filter/Query/DATA object which is our table - where would I extend the connection line from and to what object? Or is this a field within the DATA object?

A bit confused...

Former Member
0 Kudos

Hi

I Guess From Query you are getting the time. If yes then you should apply the formula in Connecting line between Query & Table.

Regards

Sandeep

Former Member
0 Kudos

Many thanks to everyone for the help.

In the end, I resorted to using the following line of code which seemed to resolve the issue (it sees the field as text):

 =MID(@MYTIME,0,5)

This subsequently returned the "00:00" I required.

Thanks Gents.