How to use Left Function correctly.

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered

I am trying to use a left function to substring a text but I dont know why is just dragging a part of the text I want.

For instance I have this  string  all saved in one field named LOG

"[NOV-02-16  4:38 PM  Walter Andrews] Modify approved.

 [NOV-02-16  4:42 PM  Walter Andrews] Modify approved.

 [NOV-02-16  5:01 PM  Walter Andrews] Meeting Approved."

Now what I am trying to do is to get the information from the left of "Meeting Approved" so I want to get  is :

"[NOV-02-16  4:38 PM  Walter Andrews] Modify approved.

 [NOV-02-16  4:42 PM  Walter Andrews] Modify approved.

 [NOV-02-16  5:01 PM  Walter Andrews] "

But I Can ́t, after I created a new Field  Formula Text type and used a formula like this : 

  var text aprob=[LOG];

  Left($aprob, "Aprobacion de Cita")

Then Just getting the following...

[NOV-02-16 

Where is the rest of the string ?  Can you help me to find it? 


   

Photo of Cesar

Cesar

  • 0 Points

Posted 2 years ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,096 Points 50k badge 2x thumb
The Left function will fire on any of the characters in your string, not the whole string as a string.

It is an off request that you are asking bit it sounds like you want this

IF(Ends([LOG], "Meeting Approved", Trim(NotRight([LOG],"]")))

So that says if the log field ends with Meeting Approved, then show the log field except hive out the rightmost characters up to the first ] character.

So while that would answer the question you posted, it is unlikely that was the answer that you need.
Photo of Cesar

Cesar

  • 0 Points
awesome !! it worked perfectly fine nonetheless I also have another question so since I got the correct date I would like to convert it to date not sure how to do it correctly because When I use ToDate Formula It returns back a date with an incorrect time.

I.E
  I tried to converted this text "11-02-2016 05:01 PM"   to datetime with the formula and It showed me back  "11-02-2016 11:01 AM" as you can see  the date it ́s correct but the time is wrong I dunno what ́s causing this.


I have below the exactly way I am using the formula to convert it so it might give a wider view.
var text result="Nov-02-2016 05:01 PM";
  
ToDate($Result,"MMDDYYYY HH:MM")

...but it returns me 11-02-2016 11:01 AM
  

I really would apprecite an answer asap
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,096 Points 50k badge 2x thumb
Try this
ToDate(ToTimeStamp($Result))