Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 extract data

Author  Topic 

imughal
Posting Yak Master

192 Posts

Posted - 2004-06-30 : 01:52:19
hi,
i have 3 tables clients, fileinfo and backpdfinfo.
client upload files in both table. when i m getting results from 3 tables it's also showing client record from fileinfo and backpdfinfo which has not uploaded files yet. i want only clients which has uploaded files. A client upload last time. my qry is.

select caclientsloginid,
(
select max(upload_date)
from fileinfo as B
where right(rtrim(filename),3)= 'zip' and
filename <> 'NULL' and
b.caclientsloginid=a.caclientsloginid
group by caclientsloginid
)as 'Un-Processed',

(
select max(upload_date) as 'Processed Send' from backpdfinfo as c
where c.caclientsloginid=a.caclientsloginid
and filename <> 'NULL'
group by caclientsloginid
) as 'Processed' ,


(
select sum(noofmonths) from backpdfinfo
where caclientsloginid = A.caclientsloginid group by A.caclientsloginid
)as 'No. Of Months'
from caclientslogin as A order by caclientsloginid

Kristen
Test

22859 Posts

Posted - 2004-06-30 : 05:48:51
Does FILENAME contain the text value "NULL", or is it set to NULL - i.e. should you be using

... filename IS NOT NULL ...

instead?

Kristen
Go to Top of Page

imughal
Posting Yak Master

192 Posts

Posted - 2004-07-01 : 00:05:44
file name contain text value.
Go to Top of Page
   

- Advertisement -