Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Gerald Fay
  Where is Gerald Fay?
 Olympia
 Washington - United States
 Gerald Fay
 Tags
Subject: Selecting Records for Monthly Statement
Thread ID: 289106 Message ID: 289106 # Views: 54 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Tuesday, December 28, 2010 11:10:02 AM         
   


Service Industry program

Database tables include

Customerinf
Billinf (Services)
Detinf (Service details)
Paymentinf

Every Billinf may have one or more services in Detinf (one to many) a unique billnumber is the relationship field as is DateServc field

Paymentinf list payments for the unique billnumber (many to one)

Customerinf is connected to all by a custnum field

Did not design Billinf to keep total for specific service as it can be summed from Detinf for that billnumber

Problem:
I need to select customers to receive a statement who have services that are over one month old and have unpaid services. The output should be ordered by CUSTOMER.

Old fashion foxpro would be to sum each deinf billnumber to a memvar, open paymentinf and sum each payment for the billnumber to a memvar, then mark a field in the billinf to send a statement if not paid.

Its clear that both detinf and paymentinf are both joined to Billinf by billnumber.

What would the Sql statement look like to create a cursor for the statement report?

Thanks.

ENTIRE THREAD

Selecting Records for Monthly Statement Posted by Gerald Fay @ 12/28/2010 11:10:02 AM
RE: Selecting Records for Monthly Statement Posted by Cetin Basoz @ 12/28/2010 11:43:41 AM
RE: Selecting Records for Monthly Statement Posted by Gerald Fay @ 12/29/2010 2:49:48 AM
RE: Selecting Records for Monthly Statement Posted by Cetin Basoz @ 12/29/2010 10:27:52 AM
RE: Selecting Records for Monthly Statement Posted by Gerald Fay @ 12/30/2010 6:48:05 AM
RE: Selecting Records for Monthly Statement Posted by Cetin Basoz @ 12/30/2010 9:05:44 AM
RE: Selecting Records for Monthly Statement Posted by Gerald Fay @ 12/30/2010 9:47:33 AM
RE: Selecting Records for Monthly Statement Posted by Cetin Basoz @ 12/30/2010 10:19:17 AM
RE: Selecting Records for Monthly Statement Posted by Gerald Fay @ 1/1/2011 7:21:04 PM
RE: Selecting Records for Monthly Statement Posted by Gerald Fay @ 1/2/2011 10:40:56 AM