Click to See Complete Forum and Search --> : Calculating Dates


Babs827
September 14th, 2006, 10:32 AM
I'm not sure if this is possible or not.

I have two date fields that I want to show the difference between. However I have another table linked with this report that has the calendar date and marks each date with a number 1 if it's a work day, number 2 if it's a weekend, number 3 if it's a holiday etc. Does anyone know of a way that I can show the difference between date1 and date2 for each record counting only the work days?

Please help!!
Thanks,
Babs827

JaganEllis
September 14th, 2006, 08:20 PM
So just count the number of 1s in the other table between the two dates, e.g. in a subreport.

sweet_babylhyn
September 14th, 2006, 10:55 PM
What database you are using? Because in MySQL there's a function DATEDIFF which will solve your problem

JaganEllis
September 15th, 2006, 01:37 AM
Really? MYSQL's DateDiff knows about his rules for holidays etc?
Wow!
:) :) :)

sweet_babylhyn
September 15th, 2006, 04:05 AM
Not exactly that way but you can create a table for holidays then make a views. MySQL can determine the date if it's saturday or sunday. Now you can use the Crystal for making a function.


What database you are using?