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
 General SQL Server Forums
 New to SQL Server Programming
 help creating a fee query

Author  Topic 

gorlock27
Starting Member

3 Posts

Posted - 2011-02-23 : 18:56:58
This is my first assignment making sql queries and I need some help with this question.

List the books that each patron currently has checked out with the patron number, patron name, telephone number, book number, and title. All books that are past due include the past due fee.

CREATE VIEW checked_out_fee AS
SELECT patron_id, first_name, last_name, phone, book_id, book_title
FROM patron, checkout, copy, book
WHERE patron.patron_id = checkout.checkout_id
AND copy.copy_id = checkout.copy_id
AND copy.book_id = book.book_id
AND due_date > retrun_date??
ORDER BY patron_id;

any suggestions would be great!

gorlock27
Starting Member

3 Posts

Posted - 2011-02-23 : 19:18:35
i've seen that you can use the DATEDIFF function. i assume you should use that somehow, but not sure.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-02-23 : 21:00:21
shouldn't it be return_date > due_date ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -