Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2009
    Posts
    12

    Unanswered: Is it possible to text in a field in a make table query?

    Can text be added to a field when the make table query is ran?

    I have a field that is just a number representing weight.
    The database does not need units as a separate field, as all weights are in pounds.

    But for a table that I will be exporting, I want to as the text

    space (or dash ) lbs.
    ie

    2
    becomes
    2 lbs
    or
    2-lbs

    Is it related to string$ ?

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    If you're running a query just change your field to be an expression, like:

    SELECT [tblName].[fldName], ...

    Becomes

    SELECT [tblName].[fldName] & " lbs" AS [Weight in Pounds], ...

    Or if you need to,

    SELECT [tblName].[fldName] & IIF([tblName].[fldName] > 1," lbs", " lb") AS [Weight in Pounds], ...
    Me.Geek = True

  3. #3
    Join Date
    Jul 2009
    Posts
    12

    Thanks for the info.

    Thanks for the info, but also have one more question.

    what if the field contains no data?
    The text lbs still appears. I tried is not null for criteria and made no diff.


    is there a way to prevent the lbs from showing if no info the weight value?
    Last edited by Jeffwillows; 07-10-09 at 01:39.

  4. #4
    Join Date
    May 2005
    Posts
    1,191
    You could nest it, try like

    SELECT [tblName].[fldName] & IIF(Len([tblName].[fldName]) > 0, IIF([tblName].[fldName] > 1," lbs", " lb"), "")
    Me.Geek = True

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •