Results 1 to 3 of 3
  1. #1
    Moragtao is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    1

    Trim and UCase in a query


    Hello all,

    I have a query where I need to run both the trim and the ucase functions on, but I can't seem to figure out how to do it without getting errors. Is there even a way to run 2 different functions on the same column in a query?

    Also, is it possible to run either the trim or the ucase function on a column in a query and keep the same column name? Or do I have to change it to something different?

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    try:

    trimmedString:trim(ucase(myfield))

    where myfield is the name of the field you want to modify

    if this is not what you want, provide the code that did not work and some examples of before and after

    Also, is it possible to run either the trim or the ucase function on a column in a query and keep the same column name? Or do I have to change it to something different?
    you have to change it otherwise sql will not know which column you are referring to. You can use the caption property to use the same name (that is what it is for) if you are only concerned about how the column will be headed

  3. #3
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    You can normally do both at the same time. If your text field was called PoorlyFormated , something like
    Code:
    NewLovelyText : UCase(Trim([PoorlyFormated]))
    In a query should work.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

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

Similar Threads

  1. Replies: 7
    Last Post: 06-20-2014, 08:55 PM
  2. Replies: 1
    Last Post: 04-16-2013, 07:57 PM
  3. Replies: 6
    Last Post: 08-10-2012, 09:30 AM
  4. how to trim text in a column using sql query of ms access
    By learning_graccess in forum Access
    Replies: 4
    Last Post: 12-05-2011, 07:15 AM
  5. Ucase
    By access2010 in forum Reports
    Replies: 1
    Last Post: 01-29-2010, 06:21 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