faulknerwilliam2 (12/1/2015)
HelloI have a simple script that brings through, for a certain product, the date it was ordered and the date the order was completed.
On a graph, I am tring to show the number ordered between a certain date and the number completed between the same date.
The problem I face is that in the script I have used:
AND job.orderdate BETWEEN (@odate1) AND (odate2)
This is absolutely fine for displaying new orders. However, when I use the same parameter for completed orders, it obviously only shows the jobs that were completed between the above parameter.
For example, if I put in November's date parameters, it will show me:
50 orders
25 jobs completed
What it will not show me is if a job completed in November where the order did not begin in November. So I may have an instance where 15 other jobs were completed in November, but because their start date was say October, they will not come through.
Can anyone suggest a way of bringing this data through? All I am trying to do is present a graph that shows: new orders and completed orders.
Thanks
Do you have a completeddate column anywhere? You'll need to change your script to include that somehow to bring through jobs that were completed in the range.
How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537