Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7542731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:14:39+00:00 2026-05-30T08:14:39+00:00

My query does run, but returns no results: SET NoCount ON SELECT Inventory.EffectiveDate, Inventory.Quantity,

  • 0

My query does run, but returns no results:

SET NoCount ON

SELECT 
   Inventory.EffectiveDate, 
   Inventory.Quantity, 
   Inventory.SourceType,
   Inventory.PickingLocation, 
   Inventory.SourceInventory,
   Locations.LocationId,
   Customers.CustomerName,
   Products.ProductId,
   LocationFrom.LocationId as lFrom,
   LocationTo.LocationId as lTo

FROM (((((((dbo.Inventory AS Inventory

   LEFT JOIN dbo.Products AS Products ON  Products.Product = Inventory.Product )
   LEFT JOIN dbo.Locations AS Locations ON Locations.Location = Inventory.Location )
   LEFT JOIN dbo.Customers AS Customers ON Customers.ConsignmentLocation = Inventory.Location )

   LEFT JOIN dbo.Inventory AS SourceLocation ON SourceLocation.Inventory = Inventory.SourceInventory)
   LEFT JOIN dbo.Locations AS LocationFrom ON LocationFrom.Location = SourceLocation.Location )

   LEFT JOIN dbo.Inventory AS TargetLocation ON TargetLocation.Inventory = Inventory.TargetInventory)
   LEFT JOIN dbo.Locations AS LocationTo ON LocationTo.Location = TargetLocation.Location)

WHERE  
    (Inventory.SourceType = 'Q' OR Inventory.SourceType = 'G' OR Inventory.SourceType = 'P' OR Inventory.SourceType = 'A' OR Inventory.SourceType = 'B') 
    AND 
    ((Inventory.EffectiveDate >= 2011-12-30 And Inventory.EffectiveDate <= 2011-12-31));

This query runs from Excel fine. But I was looking for the tool to be able to see tables, that’s why I’m using Access – but it gives me more problems….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:14:40+00:00Added an answer on May 30, 2026 at 8:14 am

    You need to surround your date parameters with single quotes.

    Inventory.EffectiveDate >= '2011-12-30'
    

    You should also consider using shorter aliases to make the code more concise. I’m not sure of the purpose of using an alias like Products to represent dbo.Products… you should also eliminate all the unnecessary parentheses if Access doesn’t force them on you.

    SET NOCOUNT ON;
    
    SELECT 
       inv.EffectiveDate, 
       inv.Quantity, 
       inv.SourceType,
       inv.PickingLocation, 
       inv.SourceInventory,
       loc.LocationId,
       cust.CustomerName,
       prod.ProductId,
       lFrom.LocationId as lFrom,
       lTo.LocationId as lTo
    FROM  dbo.Inventory AS inv
    LEFT OUTER JOIN dbo.Products  AS prod  ON prod.Product   = inv.Product
    LEFT OUTER JOIN dbo.Locations AS loc   ON loc.Location   = inv.Location
    LEFT OUTER JOIN dbo.Customers AS cust  ON inv.Location   = cust.ConsignmentLocation
    LEFT OUTER JOIN dbo.Inventory AS src   ON src.Inventory  = inv.SourceInventory
    LEFT OUTER JOIN dbo.Locations AS lFrom ON lFrom.Location = src.Location
    LEFT OUTER JOIN dbo.Inventory AS trg   ON trg.Inventory  = inv.TargetInventory
    LEFT OUTER JOIN dbo.Locations AS lTo   ON lTo.Location   = trg.Location
    WHERE  
        inv.SourceType IN ('Q', 'G', 'P', 'A', 'B') 
        AND inv.EffectiveDate >= '2011-12-30' 
        AND inv.EffectiveDate <= '2011-12-31'; -- suspect you want < '2012-01-01' here
        -- unless your column doesn't store time.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a query that does what i want joining table but i need
I am trying to optimize a query that does something like this: SELECT ...
I have written a LINQ to XML query that does what I want, but
I want to make sure a file path set via query string does not
Can anyone see what is wrong with this sql query. This returns no results,
I have a query that returns results related to items that match a specific
I have a long running query that returns a large data set. This query
I have a pretty basic query, but I'd like it to return the results
Update : Looks like the query does not throw any timeout. The connection is
The following query does what I'd like it to do, however, I have no

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.