Viewing 15 posts - 3,451 through 3,465 (of 3,544 total)
Will this do the trick
select s.salesman,s.date,
(case when (s.amount + isnull((select sum(amount) from Sales where salesman = s.salesman and date < s.date),0)) > l.Limits
then (l.Limits - isnull((select sum(amount) from Sales...
Far away is close at hand in the images of elsewhere.
Anon.
January 30, 2003 at 11:14 am
Sorry Jay, missed that one. The sql is good, so I think you are right about the data and espcially spaces, maybe try to remove them thus
select x.Vessel,x.callid,sum(x.total_minutes) as total_minutes
from...
Far away is close at hand in the images of elsewhere.
Anon.
January 27, 2003 at 6:39 am
Try
select x.Vessel,x.callid,sum(x.total_minutes) as total_minutes
into tempweek
from (select Siteid as Vessel,callid,sum(airtime) as total_minutes from oldbill02 with(index(siteid)) where callwhen >='12/31/2002' and substring(callnbr,5,3)<>'976' and siteid<>' ' group by siteid,callid
UNION
select Siteid as Vessel,callid,sum(airtime) as...
Far away is close at hand in the images of elsewhere.
Anon.
January 27, 2003 at 5:41 am
Try
declare @sql varchar(1000)
select @sql = 'insert DBTemp (TableName, trxYearMonthStart, nmbrtrx) '+
'select '+@ProcessTable+','+
'CONVERT(varchar(6), a.'+@SelectedColumn+', 112)+''01'','+
'count(*) '+
'from '+@ProcessTable+' a '+
'left outer join history h on h.TableName = '''+@ProcessTable+''' '+
'and CONVERT(varchar(6), h.'+@SelectedColumn+', 112)+''01''...
Far away is close at hand in the images of elsewhere.
Anon.
January 27, 2003 at 5:14 am
Try
declare @EmpName varchar(50)
declare @DBName varchar(50)
declare @sql nvarchar(1000)
set @DBName='EmpDB'
set @sql = 'SELECT @EmpName=LName from '+@DBName
exec sp_executesql @sql,N'@EmpName varchar(50) output',@EmpName output
Far away is close at hand in the images of elsewhere.
Anon.
January 27, 2003 at 4:47 am
Don't know about 2k but with 7 I did the following for Access 2000 db.
Created the linked server with the data source being the file name (e.g. c:\temp\db1.mdb) and set...
Far away is close at hand in the images of elsewhere.
Anon.
January 22, 2003 at 9:24 am
Don't know about 2k but with 7 I did the following for Access 2000 db.
Created the linked server with the data source being the file name (e.g. c:\temp\db1.mdb) and set...
Far away is close at hand in the images of elsewhere.
Anon.
January 20, 2003 at 2:47 am
select count(*) as 'count',c.unit,c.[date]
from (select distinct a.urn,a.[date],a.unit from #t a
inner join (select urn,min([date]) as [date],min(unit) as 'unit' from #t group by urn) b
on b.urn = a.urn and b.[date] = a.[date]...
Far away is close at hand in the images of elsewhere.
Anon.
January 15, 2003 at 4:56 am
Try
INSERT INTO table2(col1, col2, col3...col26)
SELECT t.col1, t.col2, t.col3...t.col26
FROM TempContactList t
LEFT OUTER JOIN MasterContactList m
ON m.col1 = t.col1 AND m.col2 = t.col2 AND m.col3 = t.col3...AND m.col26 = t.col26
WHERE m.col1...
Far away is close at hand in the images of elsewhere.
Anon.
January 15, 2003 at 4:30 am
Forgot to mention I use SQL7 don't know if SQL2000 is the same or not!!!!
In SQL7
under 'Select Objects to transfer'
uncheck 'Use default options'
click on 'Options' button
if you select 'Transfer SQL...
Far away is close at hand in the images of elsewhere.
Anon.
January 13, 2003 at 12:56 pm
Had same situation and problem with SQL7 and vb apps. Have since put MDAC 2.7 on IIS (4.0) server and SP4 (SQL7 SP4 has reference to fix conn problems) and...
Far away is close at hand in the images of elsewhere.
Anon.
January 13, 2003 at 3:23 am
I create script files for all my objects and therefore can create the database anywhere with any name.
If I want to transfer like you do then I do the following
Create...
Far away is close at hand in the images of elsewhere.
Anon.
January 13, 2003 at 2:52 am
I think it must a retriction with the text driver with delimited files. If you change to fixed field you should get all your data. Probably not much use if...
Far away is close at hand in the images of elsewhere.
Anon.
January 10, 2003 at 11:38 am
Antares686 is right, you have to use
set @sql = 'DECLARE curs CURSOR FOR select col1,col2 from ' + @table
exec sp_executesql @sql
OPEN curs
FETCH ....
CLOSE curs
DEALLOCATE curs
Far away is close at hand in the images of elsewhere.
Anon.
January 10, 2003 at 3:47 am
Try
set @sql = 'DECLARE z_cursor CURSOR FOR select storeid from ' + @table
exec sp_executesql @sql
OPEN z_cursor
FETCH ....
CLOSE curs
DEALLOCATE curs
Far away is close at hand in the images of elsewhere.
Anon.
January 10, 2003 at 3:44 am
Viewing 15 posts - 3,451 through 3,465 (of 3,544 total)