Re: Combining Select Queries

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On Aug 23, 4:52 am, "Barry" <some...@xxxxxxxxxxxxx> wrote:
Hi

I am intrested in combining the results of the following 2 select queries
into one to display data like this
Count1 Date1 Count2 Date2
10 1/1/2007 6 1/2/2007

SELECT Count(*) as Count1, Str(Month(User.Logged),2) + '-' +
Str(Day(User.Logged),2) + '-' + Str(Year(User.Logged),4) as Date1
FROM User
INNER JOIN Table3 ON User.UserId = Table3.UserID
INNER JOIN Table1 ON Member.Id = Table1.ID
WHERE User.Logged Between '01/01/2007' AND '10/01/2007'
GROUP BY Month(User.Logged), Day(User.Logged), Year(User.Logged)

SELECT Count(*) as Count2, Str(Month(User.Logged),2) + '-' +
Str(Day(User.Logged),2) + '-' + Str(Year(User.Logged),4) as Date2
FROM User
INNER JOIN Table3 ON User.UserId = Table3.UserID
INNER JOIN Table2 ON Member.Id = Table2.ID
WHERE User.Logged Between '01/01/2007' AND '10/01/2007'
GROUP BY Month(User.Logged), Day(User.Logged), Year(User.Logged)

Will someone please Help me.

TIA
Barry

I'm not sure exactly what you're after. Won't those queries return
the same thing? Are you wanting to crosstab the results in some
manner? How does this related to the .NET Framework?

.



Relevant Pages

  • Re: Weekly crosstab query
    ... queries for the other information and then linking the queries together by ... ensure that the queries return data for the same set of employees. ... Query Two uses query one in place of the OvertimeTracking table ... INNER JOIN qPrior ON ...
    (microsoft.public.access.queries)
  • RE: Aggregates, Joins, I am totally stuck on this issue
    ... a left outer join it makes it an inner join? ... I have two aggregate queries which are grouped on ... >> query and then create an append query which puts the results of this master ... >> a LEFT OUTER JOIN and run it and what do it get? ...
    (microsoft.public.access.queries)
  • Re: Create query from list in a table
    ... add a comboboxfor the selection of the Team. ... Steve Clark, Access MVP ... There are 15 sub queries that individully produce the information that I ... I also have one query that uses INNER JOIN to put all that data into ...
    (microsoft.public.access.queries)
  • Re: Union query and exclusion of data
    ... -- Records in A or in B but not in both (Last two queries above) ... Access MVP 2002-2005, 2007-2008 ... I am usin Access 2003 Pro and trying to create a rather complex union query but don't seem to implement conditions. ... I have tried all INNER JOIN, LEFT JOIN and RIGHT JOIN but none of them have worked so far. ...
    (microsoft.public.access.queries)
  • Re: JOIN on multiple conditions
    ... You must use the OUTER JOIN syntax, of course, ... >but if you learn only the INNER JOIN syntax does it change the way you ... More complicated queries should not be written by ... condition is placed in the ON or in the WHERE clause. ...
    (microsoft.public.sqlserver.programming)