Viewing 15 posts - 3,346 through 3,360 (of 3,544 total)
Try this
SELECT a.SiteID,
a.[DateTime],
b.Cash AS '4aTotalCash',
--Start Subquery
(SELECT SUM(b2.Cash) AS '4TotalCash'
FROM TableA a2 LEFT OUTER JOIN
TableB b2 ON a2.SiteID = b2.SiteID AND a2.[DateTime] = b2.[Date]
WHERE a2.SiteID = a.SiteID AND a2.[DateTime] =...
Far away is close at hand in the images of elsewhere.
Anon.
April 22, 2003 at 2:40 am
Use either DTS or bcp (preferred) depending on format of data (ie quoted data, field length).
Edited by - davidburrows on 04/22/2003 01:58:56 AM
Far away is close at hand in the images of elsewhere.
Anon.
April 22, 2003 at 1:58 am
Use a while loop
create table tblnames (nam varchar(20))
declare @s-2 varchar(1000),@i int
set @s-2 = 'John,,Mike,,,Sue,,'
set @i = charindex(',',@s)
while @i>0
begin
if left(@s,@i-1) <> ''
begin
insert into tblnames values (left(@s,@i-1))
end
set @s-2 = right(@s,len(@s)-@i)
set @i =...
Far away is close at hand in the images of elsewhere.
Anon.
April 17, 2003 at 9:18 am
Depending on what calls the proc you could put the 25 fields into one separated by commas and then parse this in the proc into a temp table for joining....
Far away is close at hand in the images of elsewhere.
Anon.
April 16, 2003 at 3:29 am
Ah I think the fog is beginning to clear a bit. I understand the tblprojecttasks table now and it should not give you an problems. I personally do not put...
Far away is close at hand in the images of elsewhere.
Anon.
April 15, 2003 at 8:58 am
I am still not certain where the problem lies. You use the NettblProjectTasks table to control what tasks belong to a project and what status the task is, e.g.
Project_ID TaskID...
Far away is close at hand in the images of elsewhere.
Anon.
April 15, 2003 at 6:10 am
The only way I can see is to summarise the data to see which columns are null or not null and then create sql from the results and use sp_executesql....
Far away is close at hand in the images of elsewhere.
Anon.
April 15, 2003 at 2:38 am
Are you saying that you cannot call the proc more than once? Are you getting errors from the proc? What do you mean by 'because that status is no longer...
Far away is close at hand in the images of elsewhere.
Anon.
April 15, 2003 at 2:28 am
No I don't. If you click on my name in this list then you see my email address.
Far away is close at hand in the images of elsewhere.
Anon.
April 15, 2003 at 2:05 am
I can load spreadsheet into table with or without commas in text, DTS is not processing the commas as delimiters.
Is the table you loading a permanent table?
If you email me...
Far away is close at hand in the images of elsewhere.
Anon.
April 14, 2003 at 4:00 am
Yes like this
UPDATE t1
SET t1.Field = t2.field
FROM 1stTable t1
INNER JOIN 2ndTable t2 ON t2.Field = t1.Field
but is this really a DTS question?
Far away is close at hand in the images of elsewhere.
Anon.
April 14, 2003 at 2:21 am
DECLARE @d1 AS char(6)
DECLARE @d2 as char(6)
SET @d1 = '200001'
SET @d2 = '200203'
SELECT YEAR(period) AS 'Year',DATEPART(quarter,period) as 'Quarter',
SUM(composite) AS Composite_Total
FROM tablea
WHERE CONVERT(CHAR(6),period,112) between @d1 and @d2
GROUP BY YEAR(period),DATEPART(quarter,period)
ORDER BY YEAR(period),DATEPART(quarter,period)
Edited...
Far away is close at hand in the images of elsewhere.
Anon.
April 14, 2003 at 2:12 am
Nice one Antares.
Far away is close at hand in the images of elsewhere.
Anon.
April 11, 2003 at 4:25 am
This type of query is becoming more common. I seem to remember this type in this forum before and can't remember if there was an easy solution.
My immediate thought was...
Far away is close at hand in the images of elsewhere.
Anon.
April 11, 2003 at 3:34 am
If I read you right then from your example of 200103 to 200303 you want
2002 sum value 200103 to 200203 inclusive
2003 sum value 200203 to 200303 inclusive
then I would use...
Far away is close at hand in the images of elsewhere.
Anon.
April 11, 2003 at 3:17 am
Viewing 15 posts - 3,346 through 3,360 (of 3,544 total)