Re: Simple Query Question
- From: "Plamen Ratchev" <Plamen@xxxxxxxxxxxxx>
- Date: Mon, 26 May 2008 17:49:59 -0400
Yes, you do not have the column names that you posted in your original post. Here is adjusted query (just replace 'Network Name' in the WHERE filter with the network name you are looking for):
SELECT E.enquiryID,
E.introducerID,
COALESCE(E.firstName + ' ', '') + COALESCE(E.lastName, '') AS enquiry,
E.enquiryDateTime,
I.networkName,
COALESCE(I.firstName + ' ', '') + COALESCE(I.lastName, '') AS introducerName,
I.companyName
FROM dbo.Enquiries AS E
JOIN dbo.Introducers AS I
ON E.introducerID = I.introducerID
WHERE I.networkName = 'Network Name'
AND E.enquiryDateTime >= DATEADD(DAY, DATEDIFF(DAY, 0, CURRENT_TIMESTAMP) - 30, 0);
HTH,
Plamen Ratchev
http://www.SQLStudio.com
.
- Follow-Ups:
- Re: Simple Query Question
- From: leebridgewater
- Re: Simple Query Question
- References:
- Simple Query Question
- From: leebridgewater
- Re: Simple Query Question
- From: Plamen Ratchev
- Re: Simple Query Question
- From: leebridgewater
- Re: Simple Query Question
- From: Plamen Ratchev
- Re: Simple Query Question
- From: leebridgewater
- Simple Query Question
- Prev by Date: Re: DBMS advantage and disadvantage
- Next by Date: Re: Simple Query Question
- Previous by thread: Re: Simple Query Question
- Next by thread: Re: Simple Query Question
- Index(es):
Relevant Pages
|