Jump to content

Ordering not correct in report


Daz84

Recommended Posts

Sorry if this is the wrong forum, it is relating to SQL in the context of an access database, there didn't seem to be a relevant forum for access specifically.

 

My issue is this, I have the following query which runs exactly as expected when I run it by itself

SELECT jobs.reference, workshops.name AS workshops_name, jobs.receiptno, jobs.name AS jobs_name, jobs.estimate, workshops.phone, workshops.address, jobs.item, jobs.date
FROM workshops INNER JOIN jobs ON workshops.name=jobs.workshop
WHERE (((workshops.name)=Forms!CreateReport!Workshop) And ((jobs.date)>=Forms!CreateReport!DateGoFrom And (jobs.date)<=Forms!CreateReport!DateGoTo))
ORDER BY jobs.date;

 

However when I use this query as the control source for a report the output of the report is always ordered by DESC. I have tried explicitly declaring ORDER BY jobs.date ASC but it seems to have no effect  :shrug:

 

As you will see from the WHERE clause I am using a control form called 'CreateReport' to handle the inputs but running the query directly and simply typing the inputs in has yeilded exactly the same output in all of my tests so it is not the form that is the issue. Also since the query seems to run fine when I run it independantly I suspect it is not an issue with the SQL either but in the actual report, so I am stuck. The report should not be choosing how to order it's input >:(

 

Is anyone able to clarify exactly what is going on and how I can rectify the issue? If you need any more information please ask and I shall supply.

 

Thanks

Daz

Link to comment
Share on other sites

jobs.date definately is a date field. But even if it wasn't surely I would still be able to order it properly?

 

The report is ordered by jobs.date in descending order, if it was not a date field it would not manage that properly. All I want to do is reverse the order exactly

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.