Jump to content

I need help with dates


This topic is 7900 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I hope someone can help me with this one. So here it goes.

I have three field values StartDate, EndDate, ShowTitle. These three fields I am exporting from FM as a dBase file, so I can import it into Outlook just so I can print a Calendar, all of this is working great except for one thing. In FM the SatrtDate is Thurs, Dec 5 2002 and the EndDate is Tues Dec 10 2002. What I want to happen is to have two checkboxes one for saturday and one for sunday, so if the boxes are left empty then it would make the StartDate Thurs, Dec 5 2002 and the endDate Fri, Dec 6 2002 and duplicate the record and set the new record StartDate Mon Dec 9 2002 and the EndDate to Tues Dec 10 2002. If the either checkbox is valid it would take this into account.

Please help, I'm going crazy I've tried every thing I can think of.

I have downloaded a couple of sample files in the download section and I can't get them to work.

Thank you

Kevin

Link to comment
Share on other sites

Well, that's a bit too much for me to write for you... but I'll give some pointers how I'd do it...

You need a script that is creating new records that respect your checkboxes. In pseudo-code:

For each record,

grab start and end date into globals

loop

compute next omitted day after start

if greater than end date

then just output start and end

exit loop

else

output start to omitted -1

set start global to day after omitted

endif

end loop

end for each

Hope that helps.

Link to comment
Share on other sites

Hey Jeff,

I believe what Kevin is saying is that if he enters a scheduled date range with an omission in the middle (eg: a weekend), then there are actually two ranges which he would want to export to the calendar program.

So if you schedule an ongoing meeting with a client from Thursday to Monday... you might not want that to include Saturday and Sunday. So you want a script to detect this and change your record so that there is one record for Thursday to Friday and one for Monday.

Link to comment
Share on other sites

Thank you guys for trying to help, Yes Jason that is what I want to do.

I'll try to explain it better in the following example:

StartDate (12/5/02)

EndDate (12/9/02)

Sat(Checkbox)

Sun(Checkbox)

What I want to happen is the user enters the StartDate and the EndDate and if the checkboxes are empty it would do the following:

Into a repeating field the StartDate is entered, and because the checkboxes are empty the Friday Date is entered as an Endate, then another startDate of monday is entered.

I guess the main question is:

If I have a given Startdate, how do I find the date for the upcomming Friday?

Thank You All Very Much

Kevin

Link to comment
Share on other sites

This topic is 7900 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.