Viewing 15 posts - 526 through 540 (of 569 total)
Hi,
Try this
select a.weekno,b.invtotal
from
invoices as a,
(
select weekno,sum(gross) as invtotal
from invoices
group by weekno
)as b
where
a.weekno = b.weekno
and b.invtotal > 10000
ARUN SAS
March 30, 2009 at 10:50 pm
Hi,
try this
its in the 24 hrs timing so its easy to convert
declare @starttime char(4),
@endtime char(4),
@starttimeconv char(6),
@endtimeconv char(6)
--must pass in char
select @starttime = '2000',@endtime = '2130'
select @starttimeconv = substring(@starttime,1,2)+'.'+substring(@starttime,3,4)
select @endtimeconv =...
March 29, 2009 at 10:12 pm
Hi Singh,
You need to update the space to ‘XX’
Then
UPDATE dbTABLE
set tblColA= ‘XX’
where tblColA like ' ' –space(not a singe code,with one space)
ARUN SAS
March 27, 2009 at 9:57 pm
Hi,
try this
DECLARE AllDatabases CURSOR FOR
SELECT name FROM master.dbo.sysdatabases WHERE dbid > 4
OPEN AllDatabases
DECLARE @DBNameVar NVARCHAR(128),@Statement NVARCHAR(300)
FETCH NEXT FROM AllDatabases INTO @DBNameVar
WHILE (@@FETCH_STATUS = 0)
BEGIN
PRINT N'CHECKING DATABASE...
March 27, 2009 at 9:47 pm
HI,
Try this code
declare @abc table (TEST bigint)
declare @DATE1 datetime
select @DATE1 = getdate()
insert into @abc values (convert(bigint,@DATE1))
01)
select * from @abc
RESULT
39898
02)
select convert(datetime,39898)
RESULT
2009-03-28 00:00:00.000
ARUN SAS
March 27, 2009 at 1:11 am
Hi,
Show your statement(codeing)
ARUN SAS
March 27, 2009 at 12:59 am
HI,
Try this code
create table #abc
(
part varchar(2),
qty int,
date datetime
)
insert into #abc values ('A',10,'2009-01-01')
insert into #abc values ('A',20,'2009-01-02')
insert into #abc values ('A',28,'2009-01-03')
insert into #abc values ('B',10,'2009-01-01')
insert into #abc values ('B',28,'2009-01-02')
insert into...
March 26, 2009 at 9:37 pm
Hi dub,
You need the output like this?
PART(Col1)02/18/2009(Col2)03/01/2009(Col3)03/15/2009(Col4)03/25/2009(Col5)
Part A qty 12 qty 10qty 0qty 0qty 0
Part B qty 5 qty 2qty 0qty 0qty 0
ARUN SAS
March 26, 2009 at 9:14 pm
HI,
Before inserting into the table you just made the data to upper then insert,
It’s so simple than trigger.
ARUN SAS
March 26, 2009 at 5:20 am
HI,
try this code
create table MstRun
(
RunID int IDENTITY(1,1),
RunDate datetime,
RunHorseID int,
DaysSinceLastRun int
)
create procedure HorseID_Insert
(
@RunDate datetime,
@RunHorseID int
)
as
begin
declare @Days int, @DaysUP int
select @Days = 9999
if not exists (select 'X' from MstRun
where...
March 26, 2009 at 4:29 am
HI,
1) By Increase the where condition
You want increase the speed of response?
Any how show you statement
ARUN SAS
March 24, 2009 at 11:46 pm
Hi,
Use of the DISTINCT, merges rows were all columns are identical (as mentioned in the Lynn Pettis commend) but in OP, the values not identical then why the DISTINCT should...
March 23, 2009 at 9:36 pm
HI,
TRY THIS
declare @abc table
( name1 varchar(10),
date1 datetime,
sale int,
ID1 int
)
insert into @abc values ('A','2009-03-21',90000,1)
insert into @abc values ('B','2009-03-21',60000,2)
insert into @abc values ('C','2009-03-21',70000,3)
insert into @abc values ('D','2009-03-21',90000,4)
insert...
March 21, 2009 at 3:30 am
Viewing 15 posts - 526 through 540 (of 569 total)