Click here to Skip to main content
15,923,678 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello everyone,

i am writing a sql query where suppose there are some counts of mobile numbers against each date.
ex:- jan 2- i am having count 2 (mobile nos)
feb 3- i am having count 4 (mobile nos)

and i am comparing the date from other table also.
so my question is if i click the counts then how i will get the mobile nos for that date only.

my code is

select DISTINCT A.MobileNo,convert(NVARCHAR(50),A.FTA_Date ,103) AS FTA_Date,
convert(NVARCHAR(50),A.UploadedOn ,103) AS UploadedOn,
A.RejectionReason FROM FTA_ReportReject A,FTA_Report B


here FTA_ReportReject and FTA_Report are two tables.
my problem is i which ever counts i am clicking i am getting all the values for every dates.


thanks,
Diya....
Posted
Updated 9-Mar-11 0:02am
v8
Comments
Albin Abel 9-Mar-11 4:43am    
Join those two tables and compare?

1 solution

Check the sample and change your accoedingly.
SQL
SELECT distinct
c.id, c.Column1,c.DateColumn,cat.Column1 FROM Table1 AS c
Inner Join Table2 as cat on cat.CatId=c.Id WHERE c.DateColumn='date'
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900