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 |
acebassuk
Starting Member
2 Posts |
Posted - 2004-09-27 : 09:23:48
|
HiI have a time dimension that I have created quarters in as a level below year, the syntax isdatepart("Q","dbo".DWH_PTime"."Date")this returns 1 2 3 4 below 2004I would like it to displayQTR1etccan someone please advise me how to precede the datapart function with the string "QTR"many thanksMatthew |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2004-09-27 : 10:24:42
|
have you tried:select 'QTR' + cast(datepart(q, dbo.DWH_PTime.Date)) as char(1))Go with the flow & have fun! Else fight the flow |
|
|
acebassuk
Starting Member
2 Posts |
Posted - 2004-09-28 : 06:28:42
|
Thanks for thatI tried it and it will not accept it, the error reads "column name not valid"Matthew |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2004-09-28 : 07:48:50
|
dbo.DWH_PTime.Date is not valid???show us the query.Go with the flow & have fun! Else fight the flow |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2004-09-28 : 08:53:34
|
the problem may not be with the latter part of the query...it may be the former...i.e. the "select 'QTR'" bit... |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2004-09-28 : 10:30:55
|
emmm....why?Go with the flow & have fun! Else fight the flow |
|
|
|
|
|