Create Date array using Date range 
Author Message
 Create Date array using Date range

I am having a very difficult time creating a report.  I need to
combine 2 current reports.

There are 3 tables:  Employee  , EmployeeTime,  Absence

If the employee clocks in on a particular day then there is a record
created in the EmployeeTime table, if not there is no record in the
Table for this day.  If there is a scheduled Absence, but not a clock
in then there is only a record created in the Absence Table for the
day.  If the employee clocks in for half a day and has a scheduled
absence for the rest of the day then there is a record for the day in
each Table.  If there is no scheduled absence and no clock in then
there is no record at all for the day in either table.

The problem is that I have not been able to combine the information
from the 2 tables into the report.  I can't get it to recognize both
tables as equal.  It always assumes one has a heiarchy over the other
and will only print dates that match.  I have tried using Left Join
instead of Inner Join for joing the tables, but that doesn't work.  If
I do not connect the table at all by date, instead only by employee
id, then everything prints out, but record by record and it does not
keep the dates for EmployeeTime and Absence equal in the details.

I think the only way to do this is to create a Date array from the
Date range in my SQL Query.  Then I can use this array as a Group and
step through it date by date, printing out the info from each table if
the date matches the arays date.

 I know this is confusing, but any info would be much appreciated.
Thanks, Pam



Sat, 22 Oct 2005 03:52:01 GMT  
 Create Date array using Date range
I've solved similar problems by using an unrelated table that had all of the
dates as a "driver" and doing each day as a subreport in the group footer.

<< Subject: Create Date array using Date range

Date: Mon, May 5, 2003 2:52 PM

I am having a very difficult time creating a report.  I need to
combine 2 current reports.

There are 3 tables:  Employee  , EmployeeTime,  Absence

If the employee clocks in on a particular day then there is a record
created in the EmployeeTime table, if not there is no record in the
Table for this day.  If there is a scheduled Absence, but not a clock
in then there is only a record created in the Absence Table for the
day.  If the employee clocks in for half a day and has a scheduled
absence for the rest of the day then there is a record for the day in
each Table.  If there is no scheduled absence and no clock in then
there is no record at all for the day in either table.

The problem is that I have not been able to combine the information
from the 2 tables into the report.  I can't get it to recognize both
tables as equal.  It always assumes one has a heiarchy over the other
and will only print dates that match.  I have tried using Left Join
instead of Inner Join for joing the tables, but that doesn't work.  If
I do not connect the table at all by date, instead only by employee
id, then everything prints out, but record by record and it does not
keep the dates for EmployeeTime and Absence equal in the details.

I think the only way to do this is to create a Date array from the
Date range in my SQL Query.  Then I can use this array as a Group and
step through it date by date, printing out the info from each table if
the date matches the arays date.

 I know this is confusing, but any info would be much appreciated.
Thanks, Pam >>



Sat, 22 Oct 2005 07:04:55 GMT  
 Create Date array using Date range
What adds a little bit to the confusion is that you dont
tell us how the tables are related one to another. My
hunch is that Employee ID should be  the main link
between your tables. Once you have a result set for an
employee, you can condition what you display on the
report thru a formula. I hope this helps.

Quote:
>-----Original Message-----
>I am having a very difficult time creating a report.  I
need to
>combine 2 current reports.

>There are 3 tables:  Employee  , EmployeeTime,  Absence

>If the employee clocks in on a particular day then there
is a record
>created in the EmployeeTime table, if not there is no
record in the
>Table for this day.  If there is a scheduled Absence,
but not a clock
>in then there is only a record created in the Absence
Table for the
>day.  If the employee clocks in for half a day and has a
scheduled
>absence for the rest of the day then there is a record
for the day in
>each Table.  If there is no scheduled absence and no
clock in then
>there is no record at all for the day in either table.

>The problem is that I have not been able to combine the
information
>from the 2 tables into the report.  I can't get it to
recognize both
>tables as equal.  It always assumes one has a heiarchy
over the other
>and will only print dates that match.  I have tried
using Left Join
>instead of Inner Join for joing the tables, but that
doesn't work.  If
>I do not connect the table at all by date, instead only
by employee
>id, then everything prints out, but record by record and
it does not
>keep the dates for EmployeeTime and Absence equal in the
details.

>I think the only way to do this is to create a Date
array from the
>Date range in my SQL Query.  Then I can use this array
as a Group and
>step through it date by date, printing out the info from
each table if
>the date matches the arays date.

> I know this is confusing, but any info would be much
appreciated.
>Thanks, Pam
>.



Wed, 14 Dec 2005 02:54:48 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Q:get current date and then create date range

2. Crystal Reports 8.5 date range parameter field - record selection that includes null date range

3. Date within a Range of Dates

4. date range to current date at specific time syntax question

5. Date Range - using day and month

6. Using variables for date ranges in a report

7. Using a Date Range to return data in a recordset

8. finding a range of dates using CR6 with VB6

9. Using SQL to select a range of dates (from And to) form access

10. Output format of date (using ActiveX Windows date time picker)

11. Using NT Server System Date instead of Workstations Date

12. Date - date = date

 

 
Powered by phpBB® Forum Software