Re: Combining Select Queries
- From: Brian Gideon <briangideon@xxxxxxxxx>
- Date: Thu, 23 Aug 2007 07:50:32 -0700
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?
.
- Follow-Ups:
- Re: Combining Select Queries
- From: Barry
- Re: Combining Select Queries
- References:
- Combining Select Queries
- From: Barry
- Combining Select Queries
- Prev by Date: Re: Questions about the DLR
- Next by Date: Re: Questions about the DLR
- Previous by thread: Combining Select Queries
- Next by thread: Re: Combining Select Queries
- Index(es):
Relevant Pages
|