Results 1 to 5 of 5
  1. #1
    Trek9635 is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Jan 2015
    Location
    NYC
    Posts
    7

    Database Design


    Hello Everyone. I was given this exercise and not entirely sure how to make it happen in access. I would say I am a beginner/intermediate user as far as importing excel tables and creating queries for export into excel, and creating reports out of pre existing data warehouse databases. I have not really done much as far as creating databases from scratch. I created a query to sum "Room Time" charges and a separate query from the table to sum the "Drug" charges and then a third query to IIf statement. Pretty sure there are far better ways to accomplish this. I was wondering if anyone can steer me in the right direction. The description is attached for review. Charges Exercise.doc

    Here is the sample table.
    Patient Item Description Charge
    DAVIS ROOM TIME -369.00
    DAVIS ROOM TIME 369.00
    DAVIS DRUG 1,356.00
    JACKSON ROOM TIME 369.00
    JACKSON DRUG 1,356.00
    RYAN DRUG 1,356.00
    SMITH ROOM TIME 369.00

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,973
    Not going to do your homework for you. Do your best to answer the questions and present here for critique. I will offer this - consider tables, at a minimum:

    tblPatients

    tblPatientDrugs

    tblPatientRoom
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Trek9635 is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Jan 2015
    Location
    NYC
    Posts
    7
    Ok thanks.

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,746
    Ditto on what June said. But I will point you to a tutorial that you should work through. You will learn.

    Good luck.

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,973
    Well, I think maybe my answer was a little abrupt. Since you did attempt queries (would have been nice to post them) I will expand my comments.

    The assignment does say 'build a database' and your thread topic is 'Database Design' - to me that means a relational structure.

    However, using the data of the given sample table, your 3 queries is a reasonable approach but 1 SQL statement can do it all:

    SELECT Patient, Sum(IIf(ItemDescription="Drug",Charge,0)) AS SumDrugs, Sum(IIf(ItemDescription="Room Time",Charge,0)) AS SumRoom, IIf(Sum(IIf([ItemDescription]="Drug",[Charge],0))=0,"No Drug",IIf(Sum(IIf([ItemDescription]="Room Time",[Charge],0))=0,"No Room Time","Has Both")) AS Test
    FROM [tablename]
    GROUP BY Patient;
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 2
    Last Post: 01-28-2013, 04:42 PM
  2. Database Design for Specification Database
    By khwaja in forum Database Design
    Replies: 2
    Last Post: 11-24-2011, 03:58 AM
  3. Database Design
    By accessprogram in forum Database Design
    Replies: 1
    Last Post: 12-05-2010, 12:02 AM
  4. Database design - PLEASE HELP!
    By wanderliz in forum Database Design
    Replies: 1
    Last Post: 08-22-2010, 10:56 AM
  5. Database design help
    By DaveyJ in forum Database Design
    Replies: 7
    Last Post: 06-09-2010, 04:18 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