Viewing 15 posts - 256 through 270 (of 926 total)
Can you give more detail regarding you actual scenario, like table structure, some sample data and your desired output to better understand your problem?
September 16, 2015 at 10:50 pm
Use Try_Convert instead because it will not give you any error of type casting.
Below will give you understanding
Declare @T table ( stringDate varchar(20))
insert into @T
select '2-12-2012' union all
select '11-12-2015' union...
September 15, 2015 at 7:27 am
When you say Measure S you mean Sum of Measure A + Measure B?
if so then just your Measure A + Measure B you will get your desired result.
And...
September 15, 2015 at 7:17 am
What do you exactly mean saying Parent Measure? can you share any example/detail and desired output ?
September 15, 2015 at 6:50 am
Thanks for sharing some details.
Few suggestions
1. It would be better you include FingerTable Foreign Key into you counter table as this will help you identify exactly which Counter belongs...
September 15, 2015 at 6:23 am
Check this Moving User Databases
hope it helps
September 15, 2015 at 4:25 am
faulknerwilliam2 (9/15/2015)
I have a report that uses the Datepart function to return the current, and previous, year's data:
DATEPART(YEAR, a.Date);
DATEPART(YEAR, a.Date) = DATPART(YEAR, GetDate())-1
This brings through calendar year fine.
Is it possible...
September 15, 2015 at 4:14 am
pietlinden, finanacial year start from April and end on March of the next year,
your query will not calculate properl FY
please check this
declare @OrderDate datetime = '2000-04-01'
select
DATEPART(QUARTER,@OrderDate) AS...
September 15, 2015 at 2:09 am
i agree with Eirikur suggestions.
when you say
john_rowles (9/14/2015)
Basically, there should only be one row per month-year. I want to know the pointsEarned/maxPoints for a given calendar month.
'CharacterName' column...
September 15, 2015 at 1:25 am
some of my rows have to be send to another system (which is not in my control) and I have to provide the key for it, that is why I...
September 15, 2015 at 1:15 am
ramrajan (9/4/2015)
declare @startdate datetime = '2015-03-31 23:59:59.097';declare @enddate datetime = '2015-04-01 00:00:00.000';
returns 2
Awesome simplified solution with SELECT DATEDIFF(Year, @startdate, @enddate) + 1 AS QUARTER_DIFFERENCE
Correction Year should be replaceed...
September 4, 2015 at 6:38 am
You can avoid most of this by simply creating a Calendar Table in your database. you query will become a lot simpler.
Why i used sys.all_columns (Btw well you can use...
September 3, 2015 at 4:54 am
I thought you might have figure it out but my bad, here is the complete version
declare @enddate datetime = cast('2015-09-03 00:39:53.973' as date)
declare @startdate datetime = cast('2014-11-07 00:42:39.920' as date)
SELECT...
September 3, 2015 at 4:08 am
It is best if you can have calendar table in your database. will help you a lot in these kind of queries.
However, you can do something like this as well
declare...
September 3, 2015 at 2:08 am
Viewing 15 posts - 256 through 270 (of 926 total)