Results 1 to 4 of 4
  1. #1
    cowboy is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2010
    Posts
    291

    Union Query is taking out some of my characters but only after I added input mask to table

    I have a table which I added an input mask 00\->LL\-0000 to a field MDE_Num


    Click image for larger version. 

Name:	Table.png 
Views:	20 
Size:	57.7 KB 
ID:	35318

    Then the query which pulls data from the table shows the field correctly:

    Click image for larger version. 

Name:	Query.png 
Views:	20 
Size:	48.4 KB 
ID:	35317

    Then I have a union query which pulls together 2 tables for display of both tables into another form. This query was working fine until I added the input mask and re-input the data where it doesnt have me put in the - symbols but I did specify in the input mask to store the - symbol when storing the data and it does show it in the table and the regular query. Here is the union query and SQL:

    Click image for larger version. 

Name:	Union-Query.png 
Views:	21 
Size:	41.2 KB 
ID:	35319

    Code:
    SELECT 'New' as Sub, q_NewSub.ID, NewSub.MDE_num
    FROM q_NewSub
    UNION SELECT 'Re' as Sub, q_ReSub.NewSub.ID, q_ReSub.NewSub.MDE_num
    FROM q_ReSub;
    Why is the union query not showing the - in the MDE-Num after the union query?

    I have attached the database if that helps.
    testing.mdb

    Thank you for any help you can provide.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    not sure how you can add the input mask to a union query except by using another query based on the union query and setting the input mask there. I would point out that it is an input mask and union queries are not updateable i.e. you cannot input. It is only a mask, your data is stored without the dashes as you see in your union query. So any query criteria/filter for '13-SF-1256' will fail

  3. #3
    cowboy is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2010
    Posts
    291
    Quote Originally Posted by Ajax View Post
    not sure how you can add the input mask to a union query except by using another query based on the union query and setting the input mask there. I would point out that it is an input mask and union queries are not updateable i.e. you cannot input. It is only a mask, your data is stored without the dashes as you see in your union query. So any query criteria/filter for '13-SF-1256' will fail
    On office.com it states for input masks: The 0 in the second part of the input mask indicates that the mask characters will be stored along with the data.

    I understood this to mean that the data is stored with dashes, but you are saying it just looks that way?

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    The 0 in the second part of the input mask indicates that the mask characters will be stored along with the data.
    yes - but you haven't used the second part. Once you've added that, still not sure how it would work in a union query - I suspect the relevant field from both tables will need to have the same input mask - at the very least, ensure the first table in the union has the mask.

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

Similar Threads

  1. Replies: 6
    Last Post: 04-14-2018, 03:35 PM
  2. Table Column Format/Input Mask
    By mkc80 in forum Access
    Replies: 7
    Last Post: 11-23-2012, 02:27 PM
  3. Replies: 3
    Last Post: 07-13-2011, 08:01 AM
  4. Input Mask characters stripped from table to table
    By svcghost in forum Import/Export Data
    Replies: 2
    Last Post: 12-01-2010, 10:01 AM
  5. Union query only returning 255 characters
    By jpkeller55 in forum Queries
    Replies: 25
    Last Post: 10-05-2010, 05:51 AM

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