Viewing 15 posts - 436 through 450 (of 569 total)
hi,
very basic piviting code,
try this
create table #temp
(
EmployeeID varchar(2),
StructureID varchar(2),
StructureAmount int,
DeductionID varchar(2),
DeductionAmount float
)
insert into #temp
select '01', '01', 13500, '01', 70.0
union all
select'01', '02', 1500, '02', 0.0
union all
select'01', '03', 1230, '03' ,500
union...
May 14, 2009 at 2:15 am
happycat59 (5/13/2009)
INSERT INTO @table EXEC(@SQL)SELECT
*
FROM @table
Hi,
Is this works in the SQL?
ref the post: http://www.sqlservercentral.com/Forums/Topic711409-338-2.aspx
ARUN SAS
May 13, 2009 at 10:00 pm
anu1krishna (5/11/2009)
hi allcan anybody provide me the name of indian writers for sql server beginners book which i shuld buy to increase my knoledge
Hi,
Why only Indian why not others?
ARUN SAS
May 11, 2009 at 4:31 am
t.hitendra (5/11/2009)
Hi,you can try this
select EMP_CODE,DATE_OF_BIRTH ,DATEDIFF(DD,DATE_OF_BIRTH,getdate())/365 as years,(DATEDIFF(DD,DATE_OF_BIRTH,getdate())%365)/30 as months,
DATEDIFF(DD,DATE_OF_BIRTH,getdate())%365%30 as days
from EMP_MST where accountid=4
Hitendra
Hi,
create the function like
CREATE FUNCTION AGE_ASOF_NOW (@EMP_DOB DATETIME,@curr_dt datetime)
returns varchar(1000)
AS
BEGIN
declare...
May 11, 2009 at 2:11 am
Hi,
Your output gives only the days,
The age may come in the format of years months and days like 34 years 10Months and 15 days
ARUN SAS
May 11, 2009 at 12:27 am
Hi,
try this
CREATE TABLE #tblAssessments
(
AssessmentID int IDENTITY(1,1) NOT NULL,
UserID int NULL,
AssessmentDate datetime NULL,
FollowUpCall numeric(1, 0) NULL,
HealthScore int NULL
)
insert into #tblAssessments (UserID,AssessmentDate,FollowUpCall,HealthScore)
values (1, '04-May-2009', 1, 5)
insert into #tblAssessments (UserID,AssessmentDate,FollowUpCall,HealthScore)
values (1, '06-May-2009',...
May 8, 2009 at 12:38 am
klanguedoc (5/6/2009)
select distinct custno, currency, COUNT(currency) from tblSalesgroup by custno, currency having currency = 'USD' or currency='CAD'
order by custno
Hi,
from your codeing result for count of currency alwayes one,
--only the customer...
May 7, 2009 at 3:08 am
Hi Kishore,
When the value like 1.23999
Then it’s round the value
Select @input = 1.23999, @precision = 4
Result to 1.2400
For that better...
May 7, 2009 at 2:39 am
Hi,
try this
declare @abc varchar(10)
set @abc = '1234'
select substring(@ABC,1,case when (charindex('+',@ABC)-1)< 0 then 0 else (charindex('+',@ABC)-1)end)
select substring(@ABC,(charindex('+',@ABC)+1),(len(@ABC)))
ARUN SAS
May 7, 2009 at 2:12 am
Hi,
try this
DECLARE @abc VARCHAR(1000)
SELECT @abc = 'SELECT * FROM syssegments; SELECT * FROM sysconstraints;'
select @abc = replace(@abc,';',' GO')
exec (@abc)
ARUN SAS
May 6, 2009 at 5:09 am
Hi,
See the sysjobhistory table in the msdb,
In run_status col shows the status of the job or steps
ARUN SAS
May 6, 2009 at 4:42 am
Hi suresh,
Are you trying this?
first try to bulid the coding, then show it
ARUN SAS
May 6, 2009 at 4:29 am
Hi,
your code is correct
and try with close brackets
update emp_data
set firstname=substring(name,1,(charindex('+',name)-1)),
lastname=substring(name,(charindex('+',name)+1),(len(name)))
declare @abc varchar(10)
set @abc = 'ABCD+1234'
select substring(@ABC,1,(charindex('+',@ABC)-1))
select substring(@ABC,(charindex('+',@ABC)+1),(len(@ABC)))
ARUN SAS
May 6, 2009 at 4:21 am
Viewing 15 posts - 436 through 450 (of 569 total)