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
 SQL Server Development (2000)
 WANTS SQL QUERY SOLUTION

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-12-13 : 08:24:31
shabir writes "i have two table
1)master table and (ii)attendance table
students_code is common among two
and i want to retrieve all the students and there status(i mean presnt or absent) with respect to dates

master_table[st_code,name,address]
attendance table[st_code,status,date]

i want display like

St_code 1/1/2004 1/2/2004 1/2/2004....
1 present present absent
2 present present absent
3 present present absent
4
5
.
.."

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2004-12-13 : 08:38:36
I want a million dollars!


This should be done in presentation layer!

The query should be a simple join on [st_Code]

Select A.name, B.st_Code, B.Status, B.Date
From master_Table A
Inner Join attendance_Table B
On A.st_code = B.st_Code
Where B.date between @dateRangeBegin and @dateRangeEnd

Corey
Go to Top of Page
   

- Advertisement -