Microsoft
Software
Hardware
Network
Question : Help with sql query
Hi Experts.
I'm using sql server 2005.
I have a table in which I record attendance data, the table is defined below
Tbl_NurseryPlaceAttendanc
e
NurseryPlaceId int
AttendanceDate datetime
AttendanceCode smallint
inAttendancePattern bit
isBankHoliday bit
Primary Key
NurseryPlaceId
AttendanceDate
When data is created for this table, 5 days (Mon to Friday) of data is ALWAYS created.
Here’s some examples of the data
38 22/03/2010 00:00:00 1 False False
38 23/03/2010 00:00:00 S True False
38 24/03/2010 00:00:00 S True False
38 25/03/2010 00:00:00 S True True
38 26/03/2010 00:00:00 A True False
38 29/03/2010 00:00:00 NULL False False
38 30/03/2010 00:00:00 1 True False
38 31/03/2010 00:00:00 1 True False
38 01/04/2010 00:00:00 1 True False
38 02/04/2010 00:00:00 NULL True True
And
39 22/03/2010 00:00:00 NULL True False
39 23/03/2010 00:00:00 NULL True False
39 24/03/2010 00:00:00 NULL False False
39 25/03/2010 00:00:00 NULL False True
39 26/03/2010 00:00:00 NULL False False
39 29/03/2010 00:00:00 NULL True False
39 30/03/2010 00:00:00 NULL True False
39 31/03/2010 00:00:00 NULL False False
39 01/04/2010 00:00:00 NULL False False
39 02/04/2010 00:00:00 NULL False True
I’m looking for a query that will return (for a selected NurseryPlaceId ) a result set where each row contains
Monday AttendanceDate,
Monday AttendanceCode,
Monday inAttendancePattern
Tuesday AttendanceDate,
Tuesday AttendanceCode,
Tuesday inAttendancePattern
Wednesday AttendanceDate,
Wednesday AttendanceCode,
Wednesday inAttendancePattern
Thursday AttendanceDate,
Thursday AttendanceCode,
Thursday inAttendancePattern
Friday AttendanceDate,
Friday AttendanceCode,
Friday inAttendancePattern
Any help greatly appreciated.
Answer : Help with sql query
If you have message filtering system, check how can it reject messages with non-existing domains.
Random Solutions
Blackberry browser 400 error - socketexception Connection reset
Reducing bandwidth consumption between domain controllors at multiple sites
Delphi Pagecontrol - each Tabsheet has its own popup menu
ssh 1.99 vs 2.0
page set up in a word
SQL 2008 Job can't start/stop services
Add DC to Windows Server 2003 Network - error msg
I have designed an website in flash as well in html, if the browser dont have flash then i want them to be directed to the html version, or else they need to directed to flash version
CodeDom and Windows Forms
Discrete Math, Big O, Little o