Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
omojones
Starting Member
5 Posts |
Posted - 2011-05-17 : 11:02:50
|
| AfternoonI am creating date objects for a BO universe (XI If this matters but unlikely), i am just working through everything in SQL first to make sure it's fine but cannot display quarter.The standard we've had in other universes is the followingSelect Month (Convert(datetime,Convert(Nvarchar,(getdate()),103),103)) - displays month and the same with year in front displays year. But i cannot get SQL 2005 to display quarter.I have tried using all the followingSELECT Quarter(GETDATE())SELECT datepart(q(GETDATE())SELECT datepart(qq(GETDATE())but just get told that quarter / q / qq is not a function.I've googled pretty heavily and not had much luck, i'm obviously doing something wrong.Cheers for any future help!Owen |
|
|
omojones
Starting Member
5 Posts |
Posted - 2011-05-17 : 11:04:13
|
| just thought i'd say i've tried to find this topic or similar on the forums but have failed to find anything relevant either, if someone has a link to something i've missed that would be appreciated. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-05-17 : 11:05:33
|
| SELECT datepart(Quarter,GETDATE())MadhivananFailing to plan is Planning to fail |
 |
|
|
omojones
Starting Member
5 Posts |
Posted - 2011-05-17 : 11:10:20
|
| hi theretried that and still get the following results, here are the 2 queries...Select DATEPART(quarter(Convert(datetime,Convert(Nvarchar,getdate(),103),103)))Select DATEPART(quarter(getdate())here were my responsesMsg 195, Level 15, State 10, Line 1'quarter' is not a recognized function name.Msg 195, Level 15, State 10, Line 2'quarter' is not a recognized function name. |
 |
|
|
omojones
Starting Member
5 Posts |
Posted - 2011-05-17 : 11:19:55
|
| SORRY, that's worked fine, when i used a comma instead of brackets. ie read what you wrote properly.....Cheers |
 |
|
|
|
|
|
|
|