Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Addition of two fields from two different tables

Status
Not open for further replies.

crysln

Technical User
Jun 24, 2009
9
BH
Hi
I am using Crystal Report 11 and SQL 2005.
I have two tables
1]Timecard : which stores the employee time details from 1st of month to last of month. There is one more field which stores status of employee like if he working then 'WO' if he is on leave then 'AL'(depends on type of leave.
2]Previous Time card: This table stores the status of employee and overtime details.Especeilly this table is used to enter any previous entry of employee.

Ex.Lets say current month is september and last month August.Payroll is run on every 25th of month.
When payroll for september is run time card is generated, which will store the status of employee if working then then WO if on leave then AL.Now lets say one employee had some unpaid leave on 28th of august. This entry is done through seperate form and it is stored in table "previuos time card".
My question is:
At any given date i want to add the status of employee from time card table and previous time card table.Status of employee when he was on leave??How can i get the total count of status from both tables.
Still any calrification is required please let me know
Please help

 
Do you only care about statuses that occured after the 25th of the previous month because otherwise they would have been picked up in the payroll for the previous month? What exactly are you doing with the results? You mention counting the statuses--why? Please show a sample of what your data looks like and explain what calculation you are trying to do.

-LB
 
You can do two separate counts and then add them using a Formula Field. But if you're using Running Totals which use a formula, they may come out as Null and you'll need to do an IsNull check to ensure you get an answer, even an answer of zero.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top