Results 1 to 3 of 3
  1. #1
    offie is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    176

    Question How to join fields?


    This is what I have:
    Click image for larger version. 

Name:	Capture.PNG 
Views:	5 
Size:	19.3 KB 
ID:	12829

    I want one field
    Time
    4
    4
    4
    3
    3
    5
    4
    etc...

    Each field in this query is coded as IIf([Timeliness5]=True,5,"") - probably not important. But I would like to be able to do this all in one query, not 2.

    I've tried &, +, and joins but either I am not formatting it right or they just don't work,

    Any Ideas?
    Thanks!

    Code:
    SELECT [100DocumentsPhase].[Project Nmber],
    IIf([Timeliness5]=True,5,"") AS Expr1,
    IIf([Timeliness4]=True,4,"") AS Expr2,
    IIf([Timeliness3]=True,3,"") AS Expr3,
    IIf([Timeliness2]=True,2,"") AS Expr4,
    IIf([Timeliness1]=True,1,"") AS Expr5
    FROM 100DocumentsPhase;

  2. #2
    offie is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    176
    Nevermind, I was messing up something easy, it was:

    SELECT [100DocumentsPhase].[Project Nmber],
    (IIf([Timeliness5]=True,5,"") &
    IIf([Timeliness4]=True,4,"") &
    IIf([Timeliness3]=True,3,"") &
    IIf([Timeliness2]=True,2,"") &
    IIf([Timeliness1]=True,1,"")) AS Timeliness
    FROM 100DocumentsPhase;

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Thanks for posting back with your solution. FYI: that table is not normalized. Not a good idea in an RDBMS.

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

Similar Threads

  1. Replies: 8
    Last Post: 05-31-2013, 05:20 PM
  2. Replies: 1
    Last Post: 01-28-2013, 11:59 AM
  3. Replies: 8
    Last Post: 09-26-2012, 01:51 PM
  4. Inner Join and multiple fields
    By mrr2 in forum Queries
    Replies: 25
    Last Post: 05-16-2012, 11:11 AM
  5. join date fields
    By rickscr in forum Database Design
    Replies: 4
    Last Post: 04-22-2011, 10:39 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