Wrox Programmer Forums
|
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 29th, 2006, 08:46 AM
Authorized User
 
Join Date: Jan 2006
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default How Can I Code This?

I have the following tables:

- Users (userId, names, address)
- MovieInfo (movieId, title, genre etc)
- Transactions (transactId, userId,transactionDate)
- TransactionType(TransactionTypeID, StrKeyDesc eg checkout, return, reserved)
- Transaction_Details (transactDetailsId, transactId, TransactionTypeID, movieId, DueDate, DateReturned)

In my application, when a customer checks out a movie, this information is captured both in the Transactions and Transaction_Details and like wise if he returns a movie, this information is also captured in these tables. Now you will realise that a movie will be captured twice -when checked out and when returned/checked in. My dilema is, I wish to do a query so that i can be able to list the movietitles, user/borrower, dateborrowed, due_date, returnedDate, overdue (based on dateborrowed and dueDate). I want to avoid a scenario where a movie appears twice, under checkout and checkin. All these information should be on one line as in the date, the movie was checked out, dueDate, ReturnDate and if overdue or not.

Thanks.

 
Old October 26th, 2006, 06:00 AM
Authorized User
 
Join Date: Aug 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How many copies of one movie title do you have?
You should include in the MovieInfo table the number of copies for the movie title. Then in the Transaction_Details table, state which copy went to the customer so you can track its return.

I hope this will help.

Jorge







Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent:hard disk serial code and vb code ivanlaw Pro VB 6 0 July 25th, 2007 04:05 AM
VB: .Exe file, serial code and activation code ivanlaw Pro VB 6 8 July 6th, 2007 05:44 AM
code clinic - Why wont example asp code work? jardbf Classic ASP Basics 3 April 27th, 2006 06:22 PM
Writing Client Side Script from Code-Behind code sajid_pk Classic ASP Databases 1 January 18th, 2005 12:53 AM
disable forum code within [code] blocks? nikolai Forum and Wrox.com Feedback 0 October 23rd, 2003 07:52 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.