August 9, 2011 at 6:19 am
That's already what my query is doing, anything between now and the next 3 months.
What dates are you missing in you new requirements?
August 9, 2011 at 6:48 am
Ninja's_RGR'us (8/9/2011)
That's already what my query is doing, anything between now and the next 3 months.What dates are you missing in you new requirements?
Sorry for the Mis-explanation, now the requirment is to get data for the period before the first three months if it exists that is between today's date and 3 months and also all the relavant data before three months even it is before today's date.
For e.g. say for today's date, August 9, 2011 the data that is required is for the future 3 months which is till November 9, 2011 but now in addition to that there is a new requirement to get all of the relavant data before November 9, 2011 which could exist even before August 9, 2011. This would now include all of the data between the three months and also the relavant data before August 9, 2011. The benchmark period however, would remain between current date and future 3 months.
In a summary that would be to calculate the period between today's date and future 3 months and then retrieve relevant data for all the period before the third month.
Did this explanation help you at all ?
August 9, 2011 at 6:53 am
Remove the filter for >= Today.
You'll need to add a filter for only "uncompleted" trips or something like that (however this is represented in your data). I can't relaly help you there unless I take part in the analysis stage.
August 9, 2011 at 7:11 am
Ninja's_RGR'us (8/9/2011)
Remove the filter for >= Today.You'll need to add a filter for only "uncompleted" trips or something like that (however this is represented in your data). I can't relaly help you there unless I take part in the analysis stage.
I think you have already helped me, that was it, I just needed to remove the logic for >= today and it works. But when you have an IQ < that of a mouse, no one can really help you and thats me...sorry for the unnecessary trouble...thanks again though ! people like me dont deserve to live !
August 9, 2011 at 7:36 am
little drastic, perhaps, pwalter. It's hard to measure ourselves against the likes of Ninja, but everyone starts at the bottom. As long as you learned from this, you're doing great. You put a lot of work into getting through this problem, and if I read correctly, you wanted a solution for your *own* benefit, not because you were still working on it for your employer. Kudos.
---------------------------------------------------------
How best to post your question[/url]
How to post performance problems[/url]
Tally Table:What it is and how it replaces a loop[/url]
"stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."
August 9, 2011 at 7:39 am
I remember feeling like that at least twice in my life. It's not easy to turn around but it is possible.
The first time I got back to school and became a programmer. The 2nd time around I became a consultant. Both of which made me much happier than I could have imagined.
In days like this there's nothing like family and friends. Please contact them asap and thell them you feel down and need help. Anybody else you trust?
Make sure you get out of the house and exercice, it'll help clear you mind. Dancing always makes me feel good after a few minutes.
Whatever you do, don't stay alone!
August 9, 2011 at 8:08 am
pwalter, Please keep in mind that SQL Server is too vast to have knowledge in all areas. For instance, I am not a T-SQL guru. I have more than 10 yrs experience in SQL Server. I still ask the Gurus here when ever I have to write a bit of complex T-SQL. That is because I dont write queries much. My expertise is in setting up servers and keeping it ticking at a good pace. I do not know anything about SSIS. But that does not mean that I am bad. I am good at what I do.
What you have to do is to have the will to learn. And I see that you have. You are on the right track. probably in a short time you will start helping others in this same forum where you came asking for help. Keep up the good work.
-Roy
August 9, 2011 at 8:38 am
Ninja's_RGR'us (8/3/2011)
For some reason the >= and <= signs don't show up correctly
Put the SQL code on more than 1 line in the code block.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 9, 2011 at 8:42 am
WayneS (8/9/2011)
Ninja's_RGR'us (8/3/2011)
For some reason the >= and <= signs don't show up correctlyPut the SQL code on more than 1 line in the code block.
Tx. I guess it gets confused as an html tag??
Anywho I'll keep that in mind.
August 9, 2011 at 9:07 am
This always cheers me up. I'd strongly recommend you signup to the newsletter. It's really full of great stuff (compared to most).
August 9, 2011 at 10:00 am
Roy Ernest (8/9/2011)
pwalter, Please keep in mind that SQL Server is too vast to have knowledge in all areas. For instance, I am not a T-SQL guru. I have more than 10 yrs experience in SQL Server. I still ask the Gurus here when ever I have to write a bit of complex T-SQL. That is because I dont write queries much. My expertise is in setting up servers and keeping it ticking at a good pace. I do not know anything about SSIS. But that does not mean that I am bad. I am good at what I do.What you have to do is to have the will to learn. And I see that you have. You are on the right track. probably in a short time you will start helping others in this same forum where you came asking for help. Keep up the good work.
Thanks for your advice !!!
August 9, 2011 at 12:32 pm
pwalter,
Keep your chin up. Try not to be so hard on yourself no matter how bad it gets.
Regards,
WC
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
August 10, 2011 at 9:25 am
For the next time around, you can use this tool, it generates the insert statement for the sample data. Takes only 2-3 secs per table...
August 10, 2011 at 9:49 am
Ninja's_RGR'us (8/10/2011)
For the next time around, you can use this tool, it generates the insert statement for the sample data. Takes only 2-3 secs per table...
It does? Didn't realize Mladen had that...awesome!
---------------------------------------------------------
How best to post your question[/url]
How to post performance problems[/url]
Tally Table:What it is and how it replaces a loop[/url]
"stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."
August 10, 2011 at 10:11 am
jcrawf02 (8/10/2011)
Ninja's_RGR'us (8/10/2011)
For the next time around, you can use this tool, it generates the insert statement for the sample data. Takes only 2-3 secs per table...It does? Didn't realize Mladen had that...awesome!
Check it out >
Viewing 15 posts - 46 through 60 (of 63 total)
You must be logged in to reply to this topic. Login to reply