Results 1 to 4 of 4
  1. #1
    GiSharp is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    2

    Query, VERY EASY QUESTION, I think


    Hello,
    Can someone please help explain something which I probably "learned" in my one-day, basic ACCESS course but have forgotten, namely:

    I have a database (access table) in which I store e-mailadresses in two columns. One column is for general e-mail adresses, and ne column is for direct, "personal" e-mai ladresses.
    For some contacts I have only a general e-mailadress and for others I have only a direct e-mail adress.
    I would like to make a query with just ONE column for e-mail addresses in which priority is given to direct e-mail adresses. I would like to make a query in which just ONE e-mail address occurs, PREFERABLY the direct e-mail address, but where there is no direct e-mail address, the general e-mail address will show.
    I get the feeling this is a really basic, elementary problem. Can anyone hlp, Please?
    THANK YOU?
    Signed,
    Eternally Grateful

  2. #2
    10 Gauge's Avatar
    10 Gauge is offline Getting the hang of it...
    Windows 7 64bit Access 2007
    Join Date
    Feb 2011
    Location
    Fredericksburg, VA
    Posts
    202
    You could use an expression in your query such as the following:

    Code:
    SELECT IIf(IsNull([PersonalEmail])=True,[GeneralEmail],[PersonalEmail]) AS Email
    FROM tblEmail;
    Hope this helps!

    Edit: I added what this would look like in Design View opposed to SQL view as well just for your future reference.

  3. #3
    GiSharp is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    2
    Thanks a lot 10 Gauge, this did not seem to help, though, sigh. I will pull out my manual I guess...

  4. #4
    10 Gauge's Avatar
    10 Gauge is offline Getting the hang of it...
    Windows 7 64bit Access 2007
    Join Date
    Feb 2011
    Location
    Fredericksburg, VA
    Posts
    202
    Let me know what you don't understand and I can try and help you through it because this expression will do exactly what you are trying to accomplish.

    I have attached a sample DB for you to look at.

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

Similar Threads

  1. Probably a very easy question
    By Ext1jdh in forum Queries
    Replies: 4
    Last Post: 08-02-2011, 12:26 PM
  2. Easy Question Need Help With
    By jdusaf in forum Access
    Replies: 1
    Last Post: 03-23-2011, 11:33 AM
  3. Easy Form Question
    By B-dub in forum Forms
    Replies: 3
    Last Post: 12-26-2010, 07:04 PM
  4. Easy question
    By Danzig in forum Access
    Replies: 11
    Last Post: 10-28-2010, 06:48 PM
  5. HELP NOOB! Easy question
    By SigmaBlu in forum Queries
    Replies: 1
    Last Post: 10-10-2009, 11:23 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