Re: Combining Select Queries
- From: "Barry" <someone@xxxxxxxxxxxxx>
- Date: Thu, 23 Aug 2007 20:26:45 +0530
Hi Brian
What is crosstab??
Indeed this question is not directly related to .NET Framework, but
developing website or winforms applicatins using Sql Server queries i
suppose is very much a part of .NET Framework related development, am i
right ???
Barry
"Brian Gideon" <briangideon@xxxxxxxxx> wrote in message
news:1187880632.393400.253620@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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: Brian Gideon
- Re: Combining Select Queries
- References:
- Combining Select Queries
- From: Barry
- Re: Combining Select Queries
- From: Brian Gideon
- Combining Select Queries
- Prev by Date: Re: Questions about the DLR
- Next by Date: Re: Questions about the DLR
- Previous by thread: Re: Combining Select Queries
- Next by thread: Re: Combining Select Queries
- Index(es):
Relevant Pages
|