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 7720427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:40:17+00:00 2026-06-01T03:40:17+00:00

I was using the exact same query to get data from two tables. when

  • 0

I was using the exact same query to get data from two tables. when i dont use the c.IsReceived = 0 part, it returns Dates but it doesn’t return anything when it is used. There are rows in RepDailyCollection with IsReceived = 0 for RepID = 205. What do you think i am doing wrong? This is in 2005 SQL Server. thnak you!!

Select 
  distinct RepDailyInfo.Date 
from 
  RepDailyInfo 
left outer join 
  RepDailyCollection c 
on 
  c.RepDailyCollectionID = RepDailyInfo.RepDailyInfoID
where 
  RepDailyInfo.RepID = 205 and c.IsReceived = 0

Edit:

When i use an other stored proc similar to this works fine.

Select i.Date
--i.RepDailyInfoID, i.RepID, i.TypeofDayID, i.CommuniTeeID, sum(cast(c.AmountSold as    numeric(10,2))) as AmountSold, 
--  sum(cast (c.AmountCollected as numeric(10,2))) as AmountCollected, c.NewCompanyName,c.PaymentMethod, 
--  c.TypeofCreditCard, c.CheckNumber, c.Invoice, c.Spots, TypeofDay.TypeofDay, CommuniTee.City, CommuniTee.State, 
--  CommuniTee.year, SalesRep_Info.FirstName, SalesRep_Info.LastName
from RepDailyInfo i
left outer join RepDailyCollection c on i.RepDailyInfoID = c.RepDailyInfoID 
left outer join TypeOfDay on TypeOfDay.TypeofDayID = i.TypeofDayID
left outer join SalesRep_Info on SalesRep_Info.RepID = i.RepID
left outer join CommuniTee on CommuniTee.CommuniTeeID = i.CommuniTeeID
 where i.RepID = 205 and c.IsReceived = 0 
 group by i.RepDailyInfoID, i.Date, i.TypeofDayID, i.CommuniTeeID, SalesRep_Info.FirstName, TypeofDay.TypeofDay, 
CommuniTee.City, CommuniTee.State, CommuniTee.year, SalesRep_Info.FirstName, 
SalesRep_Info.LastName, i.RepID, c.NewCompanyName, c.PaymentMethod, c.TypeofCreditCard, c.CheckNumber, c.Invoice, c.Spots
order by SalesRep_Info.FirstName desc
  • 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-01T03:40:19+00:00Added an answer on June 1, 2026 at 3:40 am

    There are a number of things wrong here.

    In the first query you have:

    Select 
      distinct RepDailyInfo.Date 
    from 
      RepDailyInfo 
    left outer join 
      RepDailyCollection c 
    on 
      c.RepDailyCollectionID = RepDailyInfo.RepDailyInfoID
    where 
      RepDailyInfo.RepID = 205 and c.IsReceived = 0
    

    Even though you say “left outer join”, due to the where clause you may as well have said inner join.

    Regardless, this query doesn’t match the second one. In the second query you are joining RepDailyCollection to RepDailyInfo on RepDailyInfoID. In the first query you are joining on completely different columns.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a POS application for the iPhone/iPod combination, using the same exact hardware
TLDR; How do I read data from a table using Entity Framework, when the
I'm trying to create a csv export of data from mysql using the following
I am using SQL Server 2008. I have a query that pulls two random
I am basically having the exact same problem as here: SQL View: Join tables
We have an WCF application which uses NHibernate to query data from the database.
I'm currently using the following query (simplified indeed) : SELECT ( SELECT COUNT(id) FROM
I'm trying to recursively get some data using connect by, which for each row
When using Ninjects ConstructorArgument you can specify the exact value to inject to specific
Exact Duplicate of: Getting the size (free,total) of a Windows Mobile phone drive using

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.