Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 2nd, 2006, 10:08 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default Order by In Report

I use order by in the query like this

ORDER BY IIF(ISNULL(SHOPDWGDETAILS.DATE_SUBMITTED),SHOPDWGD ETAILS.DATE_RETURNED,SHOPDWGDETAILS.DATE_SUBMITTED )


when query run it retreive/display the record like this

date_submitted..date_return...status
------------------------------------
.................12-12-2005.....AAN
.................27-08-2005.....AAN
23-08-2005.........................
10-12-2005.........................
...

it should be display like this.

date_submitted..date_return...status
------------------------------------
23-08-2005.........................
.................27-08-2005.....AAN
10-12-2005.........................
.................12-12-2005.....AAN
...

this is shopdrawings in and out query order by. ie
first drawing submitt and after that necessary action
drawing return to contractor. I have to see the status.
when drawing submit status nill and after return status will
AAN (APPROVED AS NOTED) ect.

how use the date submitted and date return in order by
IIF clause with ISNULL ?

I also save the requery, some other properties will change?

Mateen


 
Old December 2nd, 2006, 12:36 PM
Authorized User
 
Join Date: Jan 2006
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You may wish to rethink your approach. It looks like you are trying to change the sort order each record which I doubt is possible. How about creating a new field with your IIF and sort on that?

HTH RuralGuy (RG for short) acXP WinXP Pro
 
Old December 4th, 2006, 05:57 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

You cannot use ORDER BY in that manner. What you do is create a calculated field in your query called, say

dtmSortDate: Nz(SHOPDWGDETAILS.DATE_SUBMITTED, SHOPDWGDETAILS.DATE_RETURNED)

Then use ORDER BY dtmSortDate in your SQL statement.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old December 6th, 2006, 08:17 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for response.

problem in access report.
when report run it should retrieve records like this

date_submitted..date_return...status
------------------------------------
23-08-2005.........................
.................27-08-2005.....AAN
10-12-2005.........................
.................12-12-2005.....AAN
.......
...


when I run same query it retrieve the records as
I want. but same query run in report it not properly
display the records as above why ?
some other report properties will chnage?


order by clause working in query, but order by clause
don't work in report why ?

regards

Mateen







Similar Threads
Thread Thread Starter Forum Replies Last Post
ORDER BY Help U.N.C.L.E. SQL Server 2000 13 September 2nd, 2008 09:07 PM
Stacking order keithc BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 2 February 26th, 2006 01:08 PM
Order by in Report mateenmohd Access 2 February 6th, 2005 10:10 AM
Order by clause mateenmohd SQL Server 2000 4 April 6th, 2004 06:48 AM
document node order vs sort node order. ladyslipper98201 XSLT 2 June 5th, 2003 11:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.