Viewing 15 posts - 46 through 60 (of 89 total)
That can work with
where ((inf.vw_IXP_PSNEW_ADMS_AND_DIS.admdate_dte >= (DATEADD(dd,DATEDIFF(dd,0,GETDATE()),0) -9 ))
and (inf.vw_IXP_PSNEW_ADMS_AND_DIS.admdate_dte < (DATEADD(dd,DATEDIFF(dd,0,GETDATE()),0) -1 )))
It will check for the time for >=00:00 and upto <00:00 which mean expect value up-to 23:59
Regards,
Mitesh...
July 25, 2011 at 3:25 am
DECLARE @tbl1 TABLE
(
INT IDENTITY(1,1),
A INT,
B INT,
C INT
)
DECLARE @tbl2 TABLE
(
INT IDENTITY(1,1),
A INT,
B INT,
C INT
)
INSERT INTO @tbl1
SELECT 1,2,NULL
union all
SELECT 1,2,3
INSERT INTO @tbl2
SELECT 1,2,null
union all
SELECT 1,2,4
update T1
set
T1.A = T2.A,
T1.B...
July 24, 2011 at 12:46 am
declare @A1 smallint
declare @A2 smallint
declare @B1 char(1) --could be null
declare @b2 char(1) --could be null
declare @C1 char(1)
declare @c2 char(1)
select @A1 = 1
select @A2 = 1
select...
July 22, 2011 at 4:30 am
DECLARE @string VARCHAR(1000)
SET @string = 'aaa,bbb,ccc'
DECLARE @tblNumber TABLE
(
ID INT
)
INSERT INTO @tblNumber
SELECT TOP 100 ROW_number() OVER(order by s.object_id)
from sys.objects o,sys.objects s
select SUBSTRING(@string,id,CHARINDEX(',',@string+',',id)-id) from @tblNumber
where ID <len(@string)
AND SUBSTRING(','+@string,id,1)=','
July 22, 2011 at 3:59 am
SELECT DATEADD(MM,DATEDIFF(MM,-1,getdate()),0)-1
May 16, 2011 at 7:40 am
DECLARE @tblROWCOUNT TABLE
(
"Db name" VARCHAR(1000),
"Table Name" VARCHAR(400),
"Row Count" BIGINT
)
DECLARE @sql NVARCHAR(MAX)
SELECT @sql = 'SELECT ''?'' ,o.name, i.rowcnt FROM ?.sys.sysobjects o, ?.sys.sysindexes'
+' i...
April 27, 2011 at 5:32 am
DECLARE @Varmonth CHAR(2)
SELECT @Varmonth = 04
select @Varmonth =datediff(mm,'1899/04/01',DATEADD(mm,CAST(@Varmonth AS INT) ,0))%12 +CASE WHEN CAST(@Varmonth AS INT) = 3 THEN 12 ELSE 0 END
select @Varmonth = REPLICATE('0',2-LEN(@Varmonth))+@Varmonth
select @Varmonth
April 27, 2011 at 5:25 am
DECLARE @Numbertable table
(
ID INT PRIMARY KEY
)
INSERT INTO @Numbertable
select TOP 1000 ROW_NUMBER() OVER(order by si.object_id)
from sys.objects si,sys.objects s
declare @mylist nvarchar(100)
set @mylist = 'A,B, C, D , 1, 2,345, EFG, H,'
select COUNT(string)
from
(
select...
April 27, 2011 at 4:10 am
DECLARE @Numbertable table
(
ID INT PRIMARY KEY
)
INSERT INTO @Numbertable
select TOP 1000 ROW_NUMBER() OVER(order by si.object_id)
from sys.objects si,sys.objects s
DECLARE @separatolog TABLE
(
SeparatorLogID INT,
ID INT IDENTITY(1,1) PRIMARY KEY
)
DECLARE @STR varchar(100) = 'ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE'
DECLARE...
April 27, 2011 at 3:38 am
DECLARE @Numbertable table
(
ID INT PRIMARY KEY
)
INSERT INTO @Numbertable
select TOP 1000 ROW_NUMBER() OVER(order by si.object_id)
from sys.objects si,sys.objects s
DECLARE @separatolog TABLE
(
SeparatorLogID INT,
ID INT IDENTITY(1,1) PRIMARY KEY
)
DECLARE @STR varchar(100) = 'FN,SP,TBL,091.8891'
DECLARE...
April 27, 2011 at 3:32 am
DECLARE @STR varchar(100) = 'FN,SP,TBL,091.889'
DECLARE @Separator VARCHAR(10) = ','
DECLARE @ValueAdd VARCHAR(10) = '80990'
DECLARE @Action VARCHAR(10) = 'R'--1. P..PostFix 2. R..Prefix
SELECT @STR =
STUFF((
SELECT...
April 27, 2011 at 3:03 am
DECLARE @dtDate DATETIME
SET @dtDate = '2011/02/28'
SELECT @dtDate= dateadd(mm,datediff(mm,0,@dtDate),0)
SELECT datediff(dd,@dtDate,dateadd(mm,1,@dtDate))
April 27, 2011 at 2:40 am
DECLARE @Fathers TABLE (FatherId VARCHAR(10), age INT)
INSERT INTO @Fathers
SELECT 'Father1', 12
UNION ALL SELECT 'Father1', 17
UNION ALL SELECT 'Father2', 22
UNION...
June 8, 2010 at 4:32 am
Dear,
You have 6 column in table and you wanna to update 12 ?
May 27, 2010 at 4:32 am
;with cte as
(
select *,ROW_NUMBER() Over(partition by ttest.doctype ,ttest.doco order by ttest.doco) AS Rn from ttest,
(select t.doctype as Rn1 from ttest t group by t.doctype)a
)
select doco,doctype,rn from cte
May 27, 2010 at 4:25 am
Viewing 15 posts - 46 through 60 (of 89 total)