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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Urgent, Calculate days

Status
Not open for further replies.

Glitchen

MIS
Jun 6, 2003
48
US
I have a table that hold a couple of fields.
STARTDATE - The day the service starts
FREQTYPE - This field tells me how often a schedule occurs. Here are the vaules -1=oncall, 0=days, 1=weeks, 2=months
FREQPERIOD - This is the number of days, weeks, or months between services. a value of -1 would indicate being oncall.
DayOfWeek, Day of week for week or month-based frequencies 0=sunday 6=saturday -1=if on call
WEEKOFMONTH - week of month for month based frequencies 1-4, value of 5 if it the last week of the month,

So what I need is for this report to look at the start date then figure out what the frequency is (days, weeks, months) then look at the frequency period (how many days are between services) what day of the week it falls on and list each service date on a report. There is an example at the bottom
I have tried numerous things and I can't get it and I need this asap today. I can provide what ever anybody needs, Many thanks.

Here is an example of the output that I need

Service Frequency Every 12 weeks or 84 Days

Pickup Starting Point 1/4/2007

Pickup Schedule
3/29/2007
6/21/2007
9/13/2007
12/6/2007
2/28/2008
5/22/2008
8/14/2008
11/6/2008
1/29/2009
4/23/2009
7/16/2009
10/8/2009
12/31/2009
 
Show data (all fields involved here), and what the resultant output would be, that clarifies everything.

-k
 
Thanks for your quick reply!

Here is sample data with the relationships

Here is the service table schema

Here is the serviceinfo table schema

Here is the serviceschedule table schema

And here is the site table schema

Here is something that was created in excel wich is pretty easy but a manual process. This is what I would like to replicate in crystal
 
I appreciate your efforts here, but it's not what was asked for.

To clarify requirements, one posts example data, and then what one needs as the output using that data.


To be perfactly honest, I don't want to go through a bunch of links and try to correlate what is very simple to copy and paste in here.

I son't need you table relationships or anything like that, show what is coming into the report, and what you want out.

-k
 
If I got you correct here is what is coming in
Sitename FreqType FreqPeriod Dayofweek
Company1 1 1 6
Comapny2 1 4 5 Comapny3 1 1 0

This is what I want out

Service Frequency Every 12 weeks or 84 Days

Pickup Starting Point 1/4/2007

Pickup Schedule
3/29/2007
6/21/2007
9/13/2007
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top