+ Reply to Thread
Results 1 to 5 of 5

I have problems getting particular value based on 3 criteria in main table

  1. #1
    Forum Contributor
    Join Date
    07-30-2012
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    118

    I have problems getting particular value based on 3 criteria in main table

    Hi friends

    DB is attached. I am after a price value in query where I can get lookup values from the main table. I am not getting the values corresponding to the main table.

    Please help/
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,177

    Re: I have problems getting particular value based on 3 criteria in main table

    Your table is built incorrectly...it is not atomic.
    The fields should be:

    ID
    RouteNo
    State
    Branch
    Road_Air
    Size
    Month
    RATE

    Then you can supply the month as criteria. Or another table with ID,MONTH,RATE to correspond to the main tbl.

  3. #3
    Forum Contributor
    Join Date
    07-30-2012
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    118

    Re: I have problems getting particular value based on 3 criteria in main table

    Quote Originally Posted by ranman256 View Post
    Your table is built incorrectly...it is not atomic.
    The fields should be:

    ID
    RouteNo
    State
    Branch
    Road_Air
    Size
    Month
    RATE

    Then you can supply the month as criteria. Or another table with ID,MONTH,RATE to correspond to the main tbl.

    I have written few queries. but the result is not coming out. It just gives me either values.

    Price3 : Dlookup(Format([SvcDate]), "Prices_Table", "[routeno]= " & [Table_Name].[routeno] &" And [size]= " &[tablename].[size] &"")

    The above query just gives me wrong numbers when i execute the above query.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,907

    Re: I have problems getting particular value based on 3 criteria in main table

    As Ranman has indicated you have a spreadsheet layout and not a normalized data table for a relational database. You need to restructure your data as he has indicated to allow for easy query of your data. Look at this link on Fundamentals of RDBMS

    http://sbuweb.tcu.edu/bjones/20263/A...sDB_Design.pdf

    You will have to lose the spreadsheet mindset when working with a database or you will have difficulty extracting your data in meaningful manner. Learn about normalization and working with data tables will become very easy.

    This is the second time I have urged you to normalize your data. Your issue will not go away until you accept our advise and fix your db.
    Last edited by alansidman; 08-03-2014 at 09:34 PM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,907

    Re: I have problems getting particular value based on 3 criteria in main table

    Crossposted: http://www.accessforums.net/queries/...ble-45623.html

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. complex problems count based on many levels of criteria
    By joannelittell in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-28-2013, 04:42 PM
  2. Replies: 2
    Last Post: 04-16-2013, 06:17 AM
  3. I need to move data from main worksheet into multiple worksheets based on a criteria
    By ksenia81 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-19-2012, 05:45 PM
  4. [SOLVED] Directing to a table based on two criteria, then to a value based on a value - exel 2003
    By arsenalmom in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-15-2012, 02:32 AM
  5. Create a new table from the main table when user press Enter button
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-13-2010, 05:08 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1