Results 1 to 7 of 7
  1. #1
    m2boost is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2019
    Location
    Hickory, NC
    Posts
    7

    How to truncate a data stream

    How can I truncate a data stream like the values below?



    total cutting time: 151.2s §MES,1015
    total cutting time: 90.2s §MES,1015

    I want to extract the seconds value, like I want to see:

    151.2
    90.2

    Thanks for the help in advance!

  2. #2
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,557
    Hi There

    In a query you can use the following:-

    Expr1: Left([String],InStr(1,[String],"s")-1)

    Where String is the name of your Field in the Table

  3. #3
    m2boost is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2019
    Location
    Hickory, NC
    Posts
    7
    that clean up a lot but came back as

    total cutting time: 90.2

    I will like to display just the number as 90.2

    Anything else I can do?

    Thanks!!!!

  4. #4
    m2boost is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2019
    Location
    Hickory, NC
    Posts
    7
    I tried a mid string like the one below...

    Expr1: Mid([String],21,5)

    how ever I will get the "s" on the 90.2

    151.2
    90.2s


  5. #5
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,557
    Hi

    So you get this in the query result: total cutting time: 90.2

    If you only want to display the 90.2 without any Label then you need to generate a Report based on the query output.



  6. #6
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    How about Expr1:Trim(Replace(Left([String],InStr(1,[String],"s")-1),"total cutting time: ",""))

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  7. #7
    m2boost is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2019
    Location
    Hickory, NC
    Posts
    7
    Quote Originally Posted by Gicu View Post
    How about Expr1:Trim(Replace(Left([String],InStr(1,[String],"s")-1),"total cutting time: ",""))

    Cheers,
    That closed the deal!!!!

    Gicu and mike60smart for the help!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Truncate data
    By m2boost in forum Queries
    Replies: 2
    Last Post: 03-24-2020, 09:11 AM
  2. Replies: 15
    Last Post: 11-05-2019, 07:31 PM
  3. Truncate data
    By DCV0204 in forum Queries
    Replies: 6
    Last Post: 07-03-2012, 07:43 AM
  4. Rent income stream
    By liles in forum Access
    Replies: 2
    Last Post: 01-24-2012, 08:41 AM
  5. Truncate text
    By jgelpi in forum Programming
    Replies: 3
    Last Post: 07-16-2009, 12:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums