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

  • Home
  • SEARCH
  • 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 8488563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:34:28+00:00 2026-06-10T21:34:28+00:00

Morning, I cant work out why my query (below) is ignoring the WHERE clause

  • 0

Morning,

I cant work out why my query (below) is ignoring the WHERE clause for the amzLive. And is still returning duplicates.

SELECT  asin
FROM    dbo.aboProducts
WHERE  (asin NOT IN
             (SELECT DISTINCT productAsin
              FROM   dbo.LowestPrices
              WHERE (priceDate > GETDATE() - 1))) AND (amzLive = 'true')

It is returning a list of items, but still bringing back the ones where amzLive is set to true or false.

Can someone see where I am going wrong?

Update
DB structure as requested…
aboProducts Table

id          int            Unchecked
asin        nvarchar(50)   Checked
codeType    int            Checked
sku         nvarchar(50)   Unchecked
amzPrice    decimal(18, 2) Checked
amzLive     bit            Checked
lastUpdated datetime       Checked

LowestPrices Table

id           int            Unchecked
productAsin  nvarchar(50)   Unchecked
price        decimal(18, 2) Unchecked
postage      decimal(18, 2) Checked
priceDate    datetime       Unchecked
twAmzPrice   decimal(18, 2) Checked
  • 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-06-10T21:34:30+00:00Added an answer on June 10, 2026 at 9:34 pm
    1. Don’t use ‘true’ and ‘false’ with bits, use a 1 or 0
    2. A left join will make your query clearer and more predictable
    3. FYI, SQL Server has money datatypes

    eg

    select ASIN
    from aboProducts
        left join lowestprices
            on aboProducts.asin = lowestprices.productAsin
            and lowestprices.pricedate > (GETDATE()-1)
    where lowestprices.productAsin is null
    and aboProducts.amzlive=1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

morning all, I've been browsing around trying to work out what I've done wrong
It is 04.17 in the morning and i cant figure what is wrong! Help
Morning, im trying to store the results of any SProc call, from SQL Server2008,
I've been pulling my hair out this morning trying to figure this out. I
Today i'm very stack with a Work and jQ. I was get a morning
I've been working at this all morning and I still can't find a way
I'm a bit new to rails/RhoMobile so I can't work out how to add
morning I have some doubts about the the way php works. I cant find
I ran into a weird behavior from Oracle this morning... And I can't understand
morning i can't get the input-validation-error css to work when i have a class

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.