SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Script Library
 Grouping 1 off
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Splics
Starting Member

39 Posts

Posted - 02/23/2006 :  14:46:38  Show Profile  Reply with Quote
I am writing a report from an historical database that uses posting_times. The way the posting works is if something has a posting time of 01/01/97 00:00:00 it means that the record covers from 12/31/96 00:00:00 to 01/01/97 00:00:00.

This is where my problem is at. The report i am writing needs to be grouped by Month. Before i figured out how the posting dates worked i was using ... DATEPART(month, posting_time) AS monthDate ... for grouping purposes in the report.

Now that i have figured out how the posting dates work i am at a total loss as how to group this. I am using SQL Reporting Services 2000 to write this report.
Any help would be greatly appreciated.
Thanks
Mitch

AndrewMurphy
Flowing Fount of Yak Knowledge

Ireland
2916 Posts

Posted - 02/24/2006 :  10:18:11  Show Profile  Reply with Quote
how about subtract 1 second (on the fly) from the end dates and then group on the result???
Go to Top of Page

Splics
Starting Member

39 Posts

Posted - 02/24/2006 :  12:18:55  Show Profile  Reply with Quote
Thanks for the reply ... are you familiar with Reporting Services?
Go to Top of Page

AndrewMurphy
Flowing Fount of Yak Knowledge

Ireland
2916 Posts

Posted - 02/24/2006 :  12:21:40  Show Profile  Reply with Quote
I don't use that particular subproduct of SQLServer, but can you simulate what you need datawise in any way in regular SQL and then apply the lessons learned onwards??
Go to Top of Page

Splics
Starting Member

39 Posts

Posted - 02/24/2006 :  12:38:25  Show Profile  Reply with Quote
Thanks it worked perfectly. I have been working on this all week and you solved it in 2 seconds ... thanks alot.
Mitch
Go to Top of Page

AndrewMurphy
Flowing Fount of Yak Knowledge

Ireland
2916 Posts

Posted - 02/27/2006 :  04:09:19  Show Profile  Reply with Quote
That comes from a lot available for lateral thinking, due to amount of time spent in a horizontal position from ducking the amount of cr*p that gets throw at me at work!!!
Glad you are motoring!!!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000