Click here to Skip to main content
15,892,643 members
Home / Discussions / Database
   

Database

 
AnswerRe: from_unixtime() function Pin
pmarfleet24-Sep-07 19:47
pmarfleet24-Sep-07 19:47 
AnswerRe: from_unixtime() function Pin
Pete O'Hanlon25-Sep-07 2:36
mvePete O'Hanlon25-Sep-07 2:36 
QuestionTransfering data problem Pin
Pamela198424-Sep-07 11:06
Pamela198424-Sep-07 11:06 
AnswerRe: Transfering data problem Pin
Paul Conrad3-Nov-07 7:49
professionalPaul Conrad3-Nov-07 7:49 
QuestionBackup SQL Server Pin
Bonsta24-Sep-07 7:01
Bonsta24-Sep-07 7:01 
AnswerRe: Backup SQL Server Pin
Paul Conrad3-Nov-07 7:48
professionalPaul Conrad3-Nov-07 7:48 
QuestionProblem with certificate Pin
DerekFL24-Sep-07 5:27
DerekFL24-Sep-07 5:27 
Questionhelp me with outstanding rental payments Pin
twsted f824-Sep-07 5:17
twsted f824-Sep-07 5:17 
Hi

I am currently developing hostel management software for a local hostel. I am trying to find a way of identifying those residents who have outstanding rent payments.

The hotel/ youth hostel requires that its guests pay their rentals at the beginning of the month. The residents often stay at the hostel for periods that are often over 5 months.I need to find a way of finding out which residents have paid their renatals, and which ones have not paid their rents. This is further complicated by the fact that some residents will make one large payment at the beginning of their session and this is meant to cover them for the duration of their stay.

Each session has one account, and the total payments made are stored in the acount. I have also included the rate charged per day and the startdate of the session into the table, such that it is possible to calculate the amount that is owed and this figure can be some how be compared to the amount that has been paid.

Given these circumstances, how can I find the residents who have outstanding rents.

I havce included the table defs below.

Please do feel free to help me.

create table sessions
( sessionNumber int Identity Not null Primary Key,
startdate smalldatetime not null,
enddate smalldatetime not null,
sessionType char(15) not null,
duration int not null,
roomNumber char(5) not null references Rooms (roomNumber),
idNumber char(15) Not null references guestinfo (idnumber),
)

create table accounts
(
receiptNumber int Identity Not Null primary key,
amountpaid money not Null,
datepaid smalldatetime not null,
roomNumber char(5) not null references rooms(roomNumber),
sessionNumber int Not null references sessions(sessionNumber),
paymentType char(10),
userName char(15) Not Null references users (username),
)


---create table accpayments---
( accountNumber int identity Not Null primary key,
sessionNumber int not null references sessions(sessionNumber),
totalpaymentsmade money not null,
amountowing money not null,
rate money not null
)

twsted f8
AnswerRe: help me with outstanding rental payments Pin
pmarfleet24-Sep-07 9:45
pmarfleet24-Sep-07 9:45 
QuestionFind Exact match Pin
jebin k24-Sep-07 5:12
jebin k24-Sep-07 5:12 
AnswerRe: Find Exact match Pin
DerekFL24-Sep-07 7:50
DerekFL24-Sep-07 7:50 
QuestionSQL type statements without a connection Pin
Evan St. John24-Sep-07 4:34
Evan St. John24-Sep-07 4:34 
AnswerRe: SQL type statements without a connection Pin
Paddy Boyd24-Sep-07 4:48
Paddy Boyd24-Sep-07 4:48 
GeneralRe: SQL type statements without a connection Pin
Evan St. John24-Sep-07 4:59
Evan St. John24-Sep-07 4:59 
GeneralRe: SQL type statements without a connection Pin
Paddy Boyd24-Sep-07 5:02
Paddy Boyd24-Sep-07 5:02 
AnswerRe: SQL type statements without a connection Pin
Mike Dimmick24-Sep-07 5:08
Mike Dimmick24-Sep-07 5:08 
Questionproblem with create trigger Pin
Mohammed Elkholy24-Sep-07 2:28
Mohammed Elkholy24-Sep-07 2:28 
AnswerRe: problem with create trigger Pin
kubben24-Sep-07 8:07
kubben24-Sep-07 8:07 
GeneralRe: problem with create trigger Pin
Mohammed Elkholy24-Sep-07 9:29
Mohammed Elkholy24-Sep-07 9:29 
GeneralRe: problem with create trigger Pin
kubben24-Sep-07 10:49
kubben24-Sep-07 10:49 
AnswerRe: problem with create trigger Pin
joemonvarghese24-Sep-07 20:31
joemonvarghese24-Sep-07 20:31 
QuestionDifference between Delete and Truncate? Pin
ganeshMohan23-Sep-07 20:43
ganeshMohan23-Sep-07 20:43 
AnswerRe: Difference between Delete and Truncate? Pin
John-ph23-Sep-07 21:18
John-ph23-Sep-07 21:18 
GeneralRe: Difference between Delete and Truncate? Pin
Pete O'Hanlon23-Sep-07 22:30
mvePete O'Hanlon23-Sep-07 22:30 
GeneralRe: Difference between Delete and Truncate? Pin
John-ph23-Sep-07 23:11
John-ph23-Sep-07 23:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.