Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ken Murphy
  Where is Ken Murphy?
 Springhill
 Canada
 Ken Murphy
 To: Sunil Pandey
  Where is Sunil Pandey?
 Rajkot
 India
 Sunil Pandey
 Tags
Subject: RE: Transaction solution
Thread ID: 154184 Message ID: 154891 # Views: 1 # Ratings: 0
Version: Visual FoxPro 3 Category: Foxite: feedback
Date: Thursday, December 20, 2007 1:22:37 PM         
   


> >
> > Sunil,
> >
> > Without knowing how you designed your tables, it would be a bit difficult to tell you how to proceed. The salary slips however, are basically a report. Treat them the same as you would any other report. Use a SELECT command to gather the data into a single "flat file" non-normalized cursor and then create the report over that cursor. Something like this:
> >
> >
> > SELECT HourlyPayrollTable.*, Employee.EmpName, Employee.Address, ...
> >    FROM HourlyPayrollTable ;
> >    INNER JOIN Employee ON Employee.RecordID = MonthlyPayrollTable.EmployeeID ;
> >    WHERE HourlyPayrollTable.DateField >= ldPayrollPeriodStartDate AND ;
> >          HourlyPayrollTable.DateField <= ldPayrollPeriodEndDate AND ;
> >          llAnyOtherConditionsYouNeed ;
> >    ORDER BY HourlyPayrollTable.EmployeeID ;
> >    INTO CURSOR PayrollSlipsCursor
> > REPORT FORM MyPaySlipsReport TO PRINTER PROMPT
> > USE IN SELECT([PayrollSlipsCursor])
> > 

> >
> >
> > Ken
> > You shall know the truth - and the truth shall set you free. (John 8:33)
>
> Thanks Mr.Ken
>
> But I am sorry your Suggestion is out of range of our payroll Module and I try to understood but Can't understood.
>
> so I request you to plese give the comlete Example.(If this is possible)
>
> Thanking you.
>
> Sunil

Sunil,

Without knowing what your tables look like, it would be impossible for me to give you a solution. Worse still, if I were to give you the SELECT statement that you need, it would not teach you anything.

Lets take a look at this and compare it to something you are familliar with - adding tables to the DE of your report. When you create a report cursor, you use a SELECT statement as shown above - this bit is different because you add nothing to your report's DE and you leave the datasession property as "default."

The SELECT clause simply selects the fields that you will need for your report.

Include all of the fields from all of the tables that you might need in your pay slips report. When you use the JOIN clause, it is the same as creating a relationship between two tables. If you use a series of JOINs then it is the same as creating series of relationships.

When you add an ORDER BY clause, it is the same as setting an index order on your main table.

When you use the WHERE clause, it is the same as adding a filter to your tables.

Now that you have the general idea, give it a go over your tables. (Use the help file if you are not sure of syntax.) When you have your SELECT statement created, give it a try in the command window. At this point, do not worry about the query being slow. We can optimize it later. As I say, give it a go and come back here if you have more questions.

Ken
You shall know the truth - and the truth shall set you free. (John 8:33)

ENTIRE THREAD

Transaction solution Posted by Sunil Pandey @ 12/13/2007 4:34:32 AM
RE: Transaction solution Posted by Vladimir Zhuravlev @ 12/13/2007 6:56:03 AM
RE: Transaction solution Posted by Sunil Pandey @ 12/18/2007 8:27:03 AM
RE: Transaction solution Posted by Ken Murphy @ 12/18/2007 12:41:14 PM
RE: Transaction solution Posted by Sunil Pandey @ 12/20/2007 6:53:32 AM
RE: Transaction solution Posted by Ken Murphy @ 12/20/2007 1:22:37 PM
RE: Transaction solution Posted by Ken Murphy @ 12/13/2007 1:21:32 PM
RE: Transaction solution Posted by Benny Thomas @ 12/14/2007 1:11:37 PM