Viewing 15 posts - 16 through 30 (of 70 total)
I believe you removed the blank space after the comma, then you must change the third parameter of the function Stuff to 1:
,1,...
February 18, 2015 at 12:47 pm
You can add Distinct:
STUFF( (Select Distinct ', ' + isnull(MSM.ShortDesc,'')
Hope this helps.
February 18, 2015 at 12:24 pm
Hi,
Try:
STUFF( (Select ', ' + isnull(MSM.ShortDesc,'')
From From rpt_DriveShiftDetail DSD
Inner Join rpt_DriveShiftMobileDetail DSMD
...
February 18, 2015 at 10:23 am
Hi,
Try something like this:
with
CTE_Groups as
(
select distinct GrpName
...
February 6, 2015 at 11:39 am
Try:
with CTE_In as
(
select
Employee,
[Function],
...
January 30, 2015 at 1:15 pm
Hi,
Try something like this:
select
Employee,
CAST([DateTime] as Date) as Date1,
...
January 30, 2015 at 12:31 pm
Try:
Select
DocketId,
AssignmentType,
AssignedStaff
From -- ...
Hope this helps.
January 29, 2015 at 1:11 pm
I do not know if I understand correctly, but try adding the Having clause:
select d.dname, count(e.eid) [emp_count]
from tb_emp e
inner join tb_dept d
on e.did = d.did
group...
January 28, 2015 at 10:46 am
Hi,
Try something like this:
With Record (Months,RScore,RAmount,Rvisit,TotalAmt) as (
select 'JAN' as Months, 50 as RScore,20 as RAmount,10 as Rvisit,200 as TotalAmt union all
select 'FEB',44,13,8,100 union all
select 'MAR',32,13,8,100 union all
select 'APR',70,13,8,100...
January 16, 2015 at 9:21 am
Try:
with CTE_RN as
(
select
*,
ROW_NUMBER() OVER(PARTITION BY HouseName ORDER BY HouseName) as...
January 16, 2015 at 6:39 am
Try:
Select dateadd(day, datediff(day, 0, datefield), 0) as datefield
from datetable
Hope this helps.
January 15, 2015 at 9:48 am
Try:
DECLARE @RPT_DTA VARCHAR(6)
SET @RPT_DTA = CONVERT(varchar(6), DATEADD(MONTH, -1, GetDate()), 112)
SELECT @RPT_DTA
DECLARE @RPT_DTB VARCHAR(10)
SET @RPT_DTB = CONVERT(VARCHAR(10), DATEADD(MONTH, DATEDIFF(MONTH, 0, GetDate()) - 1, 0), 120);
SELECT @RPT_DTB
or
SET @RPT_DTB = CONVERT(VARCHAR(8), DATEADD(MONTH,...
December 16, 2014 at 12:51 pm
Hi,
Try something like this:
with CTE_User as
(
select
UserID
from MyTable
group by
...
December 2, 2014 at 5:49 am
Try:
select
*
from #test as t
cross apply
(
select top(1)
t1.Pts
from #test1 as t1
...
December 2, 2014 at 5:37 am
The query2 problem is not in Coalesce function.
The query2 is not concatenating the value of the variable @sql with the value of Names column, so the result is...
November 27, 2014 at 7:11 am
Viewing 15 posts - 16 through 30 (of 70 total)