Re: Concatenate with ORDER BY clause
- From: John Spencer <spencer@xxxxxxxxx>
- Date: Fri, 30 May 2008 12:21:45 -0400
Have you tried the following?
SELECT T1.ProjectID, T1.RenewAmendID, T1.DateReceived,
Concatenate("Select IssueDate & ': ' & Issue FROM tbl_RenewAmendComments
WHERE RenewAmendID =" & [RenewAmendID] & " ORDER BY IssueDate DESC",Chr(13) & Chr(10)) AS Issues
FROM tbl_RenewORAmend AS T1
WHERE (((T1.DateReceived)=(SELECT MAX(T2.DateReceived)
FROM tbl_RenewORAmend as T2
WHERE T2.ProjectID = T1.ProjectID)))
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
BillA wrote:
I am using Duane Hookom’s concatenate function and am having difficulty including an ORDER BY clause in its select statement. Below is the SQL that I've been beating my head against. Everything works as expected, however I am trying to order the concatenated field in Descending order by 'IssueDate.' Any suggestions?.
SELECT T1.ProjectID, T1.RenewAmendID, T1.DateReceived, Concatenate("Select IssueDate & ': ' & Issue FROM tbl_RenewAmendComments
WHERE RenewAmendID =" & [RenewAmendID],Chr(13) & Chr(10)) AS Issues
FROM tbl_RenewORAmend AS T1
WHERE (((T1.DateReceived)=(SELECT MAX(T2.DateReceived)
FROM tbl_RenewORAmend as T2
WHERE T2.ProjectID = T1.ProjectID)))
Thank you,
Bill
- Prev by Date: Re: Help with Date Range
- Next by Date: Re: how to name field to include a date range...
- Previous by thread: Re: Need help with my query for comparing two tables?!
- Next by thread: Re: how to name field to include a date range...
- Index(es):
Relevant Pages
|
|