Viewing 15 posts - 916 through 930 (of 1,114 total)
As you told if we want to display -1 or some other negative values,
we need to write,
select * from sometable where column > 0
select * from sometable where column...
karthik
December 31, 2007 at 2:32 am
Yes I got it.But,
A Little late here,As per SQL-92 standard,if ANSI_NULLS option is on, will return FALSE only.
So before executing this code
------------------------------
DECLARE @Var1 INT
SET @Var1 = NULL
SELECT
CASE WHEN @Var1...
karthik
December 31, 2007 at 2:17 am
Jeff,
SELECT * FROM sometable WHERE ISNULL(Column2, 0) <> 0
SELECT * FROM sometable WHERE Column2 IS NOT NULL AND Column2 <>...
karthik
December 31, 2007 at 1:48 am
A Little late here,As per SQL-92 standard,if ANSI_NULLS option is on, will return FALSE only.
So before executing this code
------------------------------
DECLARE @Var1 INT
SET @Var1 = NULL
SELECT
CASE WHEN @Var1 =...
karthik
December 31, 2007 at 1:39 am
Also,Dateadd(month,0,0)
Here,
1st - Zero stands for Number to be added to the month part.
2nd -Zero Stands for 1900-01-01(Default Datetime).
It will show 1900-01-01.
Dateadd(month,0,-1)
Here,
1st - Zero stands for Number to be added to...
karthik
December 31, 2007 at 12:17 am
Michael,
select FirstOfThisMonth =dateadd(month,datediff(month,0,getdate()),0),LastOfThisMonth =dateadd(month,datediff(month,-1,getdate()),-1),FirstOfLastMonth =dateadd(month,datediff(month,0,getdate())-1,0),LastOfLastMonth =dateadd(month,datediff(month,-1,getdate())-1,-1)
Thanks.only the first two was worked.
I have made some changes in the last 2 statements.
FirstOfLastMonth =dateadd(month,datediff(month,0,dateadd(mm,-1,getdate())),0),
LastOfLastMonth =dateadd(month,datediff(month,-1,dateadd(mm,-1,getdate()),-1)
It gave last month's firstdate & lastdate.
karthik
December 31, 2007 at 12:12 am
I am going to try it and get back to you.
karthik
December 21, 2007 at 5:19 am
@length/2.0 + 1
I am not able to understand the above statement.Why are you dividing it by 2 and add with 1.
karthik
December 21, 2007 at 5:09 am
Can you tell me where exactly you can apply spt_values table?
I mean In which situations you go to spt_values.can you list out some examples ?
Also, say for example if...
karthik
December 21, 2007 at 5:05 am
I don't have the permission to create function.Can you give me the solution without function ?
karthik
December 21, 2007 at 4:47 am
We can use REVERSE() Function.I agreed.
But my friend faced the above question in his recent interview.Interviewer asked him not to use REVERSE() Function.But he failed to answer. Thats why i...
karthik
December 21, 2007 at 3:51 am
Madhivanan,
Thanks.Suppose if i have like this,
Declare @Str varchar(300)
@Str = 'Karthikeyan,Madhivanan,JeffModen,Steve-Jhones,MattMiller,GilaMonster'
do we have to repeat your code for 6 times? Suppose if i have around 20 names do we repeat the...
karthik
December 21, 2007 at 3:45 am
I dont want to use REVERSE() Function. I need pure sql code logic which could check whether it is palindrome or not.
karthik
December 21, 2007 at 3:40 am
@str length is varchar(50) only.
karthik
December 21, 2007 at 2:42 am
Viewing 15 posts - 916 through 930 (of 1,114 total)