Print order by Date

B

Bob

At the moment this code prints in order of the latest tblRemarks.dtDate, if
there is no date can the print order by tblRemarks.Category
(Asending)...Thanks for any help...Bob

SELECT tblRemarks.dtDate, funGetHorse(0,tblHorseInfo.HorseID,false) AS
HorseName1, tblRemarks.Category, tblRemarks.Remark FROM tblRemarks ,
tblHorseInfo,qryCategory where tblRemarks.HorseID=tblHorseInfo.HorseID and
qryCategory.HorseID = tblHorseInfo.HorseID and qryCategory.dtdate1 =
tblRemarks.dtDateORDER BY tblRemarks.dtDate DESC;
 
B

Bob

Oops sorry here is the Private Sub
Private Sub Report_Open(Cancel As Integer)
Category.ControlSource = "='" & Form_frmMain.cbCategory & "'"
Me.RecordSource = "SELECT tblRemarks.dtDate, funGetHorse(0,
qryCategory.HorseID,false) AS HorseName1, " _
& " tblRemarks.Category, tblRemarks.Remark FROM tblRemarks, qryCategory
WHERE qryCategory.HorseID " _
& " = tblRemarks.HorseID And qryCategory.RemarkID1 = tblRemarks.RemarkID
" _
& " and tblRemarks.Category='" & Form_frmMain.cbCategory & "'" _
& " ORDER BY tblRemarks.dtDate DESC; "
Debug.Print Me.RecordSource
End Sub

Thanks Bob
 
J

JK

Bob,

ORDER BY tblRemarks.dtDate DESC, tblRemarks.Category;

Regards
Jacob

| Oops sorry here is the Private Sub
| Private Sub Report_Open(Cancel As Integer)
| Category.ControlSource = "='" & Form_frmMain.cbCategory & "'"
| Me.RecordSource = "SELECT tblRemarks.dtDate, funGetHorse(0,
| qryCategory.HorseID,false) AS HorseName1, " _
| & " tblRemarks.Category, tblRemarks.Remark FROM tblRemarks, qryCategory
| WHERE qryCategory.HorseID " _
| & " = tblRemarks.HorseID And qryCategory.RemarkID1 =
tblRemarks.RemarkID
| " _
| & " and tblRemarks.Category='" & Form_frmMain.cbCategory & "'" _
| & " ORDER BY tblRemarks.dtDate DESC; "
| Debug.Print Me.RecordSource
| End Sub
|
| Thanks Bob
|
| >
| > At the moment this code prints in order of the latest tblRemarks.dtDate,
| > if there is no date can the print order by tblRemarks.Category
| > (Asending)...Thanks for any help...Bob
| >
| > SELECT tblRemarks.dtDate, funGetHorse(0,tblHorseInfo.HorseID,false) AS
| > HorseName1, tblRemarks.Category, tblRemarks.Remark FROM tblRemarks ,
| > tblHorseInfo,qryCategory where tblRemarks.HorseID=tblHorseInfo.HorseID
and
| > qryCategory.HorseID = tblHorseInfo.HorseID and qryCategory.dtdate1 =
| > tblRemarks.dtDateORDER BY tblRemarks.dtDate DESC;
| >
|
|
 
B

Bob

Thanks Jacob, and then Remark field next to ascending
ORDER BY tblRemarks.dtDate DESC, tblRemarks.Category; tblRemarks.Remark
ASCENDING ???
Regards Bob
 
B

Bob

Got it but dont know the short cut to Ascending for Remark
& " ORDER BY tblRemarks.dtDate DESC,tblRemarks.Remark DESC,
tblRemarks.Category ;"
Thanks Bob
 
B

Bob

Thanks got it ASC...Bob

Bob said:
Got it but dont know the short cut to Ascending for Remark
& " ORDER BY tblRemarks.dtDate DESC,tblRemarks.Remark DESC,
tblRemarks.Category ;"
Thanks Bob
 
D

Douglas J. Steele

Did you not read what Tom posted? It doesn't matter what ORDER BY clause you
have on the query when dealing with a report. You MUST use the Sorting and
Grouping feature of the report.

(And, for what it's worth, Ascending is the default, so it's not really
necessary to include the ASC in a query)
 
B

Bob

Douglas, Tom Who, I can not see a posting on this tread from Tom!
and I can assure you that the 2nd list being Remarks was not in any
alphabetical , Thanks Bob
 
T

Tom Wickerath

Hi Bob,

You might want to try switching your newsgroup server to news.microsoft.com.
My contribution to your thread is showing up on that server.



Tom Wickerath

PS:

This message posted using the news server "newsgroups.comcast.net", just in
case you are not seeing any messages posted to news.microsoft.com. Also,
here is a link to your thread using the Microsoft "web portal":

http://www.microsoft.com/office/com...cess&mid=11bdab57-bf7b-4fe5-bf7e-19287900215e

____________________________________________


Sorry Douglas I am using Microsoft Outlook Express and not showing here,
thanks Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top