Viewing 15 posts - 226 through 240 (of 1,114 total)
Greg,
it is not giving the expected result. I have to get the minimum Eff_date(where Eff_date is greater than getdate() ) then the correspoinding id should be displayed.
June 2, 2009 at 4:10 am
The table contains only the date not datediff.
so first i need to calculate the datediff,then i need to get the id.
Modified Table Structure:
Create table Log
(
ecode int,
id int,
Eff_Date datetime
)
insert into log
select...
June 1, 2009 at 5:52 am
I used the below query to get the id.
select id from
log where ecode = 100
and datediff = (select min(datediff)
from log
where ecode = 100)
There is a small change in the...
June 1, 2009 at 5:48 am
I got this backup file from (SDMS_OLAP.bak) some one of my team person.
There is no option to create one more backup as the server is not available now.
Using this...
May 18, 2009 at 9:26 am
Sergiy (5/15/2009)
karthikeyan (5/15/2009)
I have one scenario.
declare @mm char(2)
declare @gdate datetime
select @gdate = '03/31/2009'
select @mm = convert(char(2),datepart(month,@gdate))
select @mm
It is showing 3. But i need the output as 03.
I modified...
May 18, 2009 at 3:41 am
Lynn Pettis (5/7/2009)
karthikeyan (5/7/2009)
Lynn,Yes.It will work.. But I have more than one row in the table,so i can't use local variable here, becuase it lead us to use 'LOOP'.
Really, and...
May 11, 2009 at 4:30 am
Sergiy (5/7/2009)
karthikeyan (5/7/2009)
Sorry! I am not getting you...Try again.
Here is a shorter version of your code, easier to get:
DECLARE @Fixed2 decimal(8,4)
SET @Fixed2 = 12121.03
Thanks Sergiy! I have identifed my mistake...i...
May 11, 2009 at 4:26 am
Lynn Pettis (5/7/2009)
karthikeyan (5/7/2009)
Lynn Pettis (5/6/2009)
karthikeyan (5/6/2009)
DECLARE @Fixed1 decimal(8,4), @Fixed2 decimal(8,4), @Fixed3 decimal(16,8);
SET @Fixed1 = 5444.32;
SET @Fixed2 = 12121.03; <-- Problem is here. decimal(8,4)...
May 11, 2009 at 4:25 am
Lynn Pettis (5/6/2009)
karthikeyan (5/6/2009)
DECLARE @Fixed1 decimal(8,4), @Fixed2 decimal(8,4), @Fixed3 decimal(16,8);
SET @Fixed1 = 5444.32;
SET @Fixed2 = 12121.03; <-- Problem is here. decimal(8,4) means you only...
May 7, 2009 at 9:32 pm
RBarryYoung (5/6/2009)
There is a course in most graduate & undergraduate math & CompSci programs called "Numerical Analysis", have you taken it yet? I ask because it is...
May 7, 2009 at 9:27 pm
Lynn,
Yes.It will work.. But I have more than one row in the table,so i can't use local variable here, becuase it lead us to use 'LOOP'.
May 7, 2009 at 9:25 pm
I tried the below code
DECLARE @Fixed1 decimal(8,4), @Fixed2 decimal(8,4), @Fixed3 decimal(16,8);
SET @Fixed1 = 5444.32;
SET @Fixed2 = 12121.03;
SET @Fixed3 = @Fixed1 * @Fixed2;
SELECT @Fixed3
I got the truncation error.
To multiply two decimal(8,4)...
May 6, 2009 at 11:01 am
Sergiy,
FLOAT worked well. Can you tell me why my code failed to give the accurate result?
Also i have to convience my manager to alter the table to FLOAT data...
May 6, 2009 at 3:12 am
Lynn,
I am using sql2000.
I have identified the month end date for the given input range now.
i.e input date = 28/apr/2009
so @year_st = 01/01/2009
@year_end = 28/apr/2009 --...
April 28, 2009 at 3:13 am
Thanks Jeff.
Meantime i have developed the below code to get the desired output...
DECLARE @Input_Date DATETIME
SELECT @Input_Date = '28/apr/2009'
DECLARE @Year_St DATETIME,
@Year_End DATETIME
SELECT...
April 28, 2009 at 3:01 am
Viewing 15 posts - 226 through 240 (of 1,114 total)