Results 1 to 2 of 2
  1. #1
    shsh_shah is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2009
    Posts
    5

    Query returns null..based on two tables

    Hi, I have two tables and following is there datatype
    Products Table:
    P.ID-AutoNumber as datatype
    ProductName-Text as datatype
    ProductType-Text as datatype
    Price- number as datatype
    Packing-number as datatype

    Packing Table:

    PackingID=Autonumber as datatype
    PackingName - Text as datatype


    and i am bit confused as how the query will be to get the price of the product based on above tables bec when i run

    SELECT distinct Products.CPrice
    FROM Packing INNER JOIN Products ON Packing.PackingID=Products.Packing WHERE (([WHERE Products].[ProductName]="@prod" And [WHERE Packing].[PackingName]="@pac"));



    I get nothing in result..any help please..I really need this somehow to solve...please advise

  2. #2
    thhui is offline Competent Performer
    Windows XP Access 2002 (version 10.0)
    Join Date
    Feb 2009
    Posts
    235
    Packing.Packing ID=Products.Packing
    These two fields should be of same datatype=Long as Packing ID is AutoNumber.
    Pls check the Product.Packing 's datatype. Make sure it is Long.


    The sql statement should be refined as:-

    SELECT distinct Products.CPrice
    FROM Packing INNER JOIN Products ON Packing.PackingID=Products.Packing WHERE ([Products].[ProductName]="@prod" And [Packing].[PackingName]="@pac");

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

Similar Threads

  1. Problem with Report Based on a Query
    By gmalaret in forum Reports
    Replies: 1
    Last Post: 11-25-2008, 08:38 AM
  2. Form Based Query/Filter
    By Micon in forum Access
    Replies: 0
    Last Post: 11-07-2008, 09:25 AM
  3. query based on two combobox
    By datto in forum Queries
    Replies: 0
    Last Post: 04-18-2007, 11:10 PM
  4. Run a PivotChart form based on query
    By Suzan in forum Queries
    Replies: 0
    Last Post: 06-11-2006, 03:48 AM
  5. Null Values not showing up in a Query
    By Valli in forum Queries
    Replies: 0
    Last Post: 01-04-2006, 03:53 PM

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