elvis_impersonating_penguin Posted March 21, 2001 Share Posted March 21, 2001 ok i have two fields in my database (well actually i have more than 2 fields, but these 2 are the only ones that are important for this scenario) The fields are Begin Date, and End Date. Now i was wondering if i could fill in a calculation field with those dates and all date in between. for instance if i put 03/11/2001 into my begindate field, and 03/15/2001 into my end datefield, my new calculation field would look something like this 03/11/2001 03/12/2001 03/13/2001 03/14/2001 03/15/2001 is this possible at all?? of course would also have to work if the days were no in the same month. like if i had 03/30/2001 and 04/02/2001 my new field would contain: 03/30/2001 03/31/2001 04/01/2001 04/02/2001 any ideas?? thanks.. Link to comment Share on other sites More sharing options...
Kurt Knippel Posted March 21, 2001 Share Posted March 21, 2001 quote: Originally posted by bman: ok i have two fields in my database (well actually i have more than 2 fields, but these 2 are the only ones that are important for this scenario) The fields are Begin Date, and End Date. Now i was wondering if i could fill in a calculation field with those dates and all date in between. for instance if i put 03/11/2001 into my begindate field, and 03/15/2001 into my end datefield, my new calculation field would look something like this 03/11/2001 03/12/2001 03/13/2001 03/14/2001 03/15/2001 is this possible at all?? of course would also have to work if the days were no in the same month. like if i had 03/30/2001 and 04/02/2001 my new field would contain: 03/30/2001 03/31/2001 04/01/2001 04/02/2001 any ideas?? thanks.. There are some scripts and long calculations that make this possible, but I find them pretty unweildly. However Troi Automastering (www.troi.com) makes a Ranges plugin which allows you to do this in a simple calculation. Also Waves in Motion makes the oAzium Date plugin that has this feature. ------------------ =-=-=-=-=-=-=-=-=-=-=-=-= Kurt Knippel Consultant Database Resources mailto:[email protected] http://www.database-resources.com =-=-=-=-=-=-=-=-=-=-=-=-= Link to comment Share on other sites More sharing options...
elvis_impersonating_penguin Posted March 21, 2001 Author Share Posted March 21, 2001 yeah, i kind of figured this was going to a pain in the butt.. Link to comment Share on other sites More sharing options...
LiveOak Posted March 21, 2001 Share Posted March 21, 2001 Kurt and I might disagree a little on this one. I don't think the script to perform what you wish is too cumbersome and seems plenty fast for several month ranges of dates. If you a building a related find, you'll want carriage returns between dates. The fill script looks like: If (enddate > begindate or IsEmpty(begindate) or IsEmpty(enddate)) Exit Script Endif Set Field (Date, "") Set Field (gDateTemp, begindate) Loop Set Field(Date, Date & gDateTemp & " ") Exit Loop If (Date = enddate) Set Field(Date, Date + 1) End Loop The error check at the beginning could set the enddate to the begindate, if enddate is blank or whatever checks you wish. -bd Link to comment Share on other sites More sharing options...
Kurt Knippel Posted March 22, 2001 Share Posted March 22, 2001 quote: Originally posted by bman: ok.. nifty nifty, looks like fun.. one question how would i get that script to run every time a new record is created??? there might be a problem with this though.. the records are created through a web interface and scripts are somtimes un reliable when run through web interfaces. This is one of those situations where a plug-in makes your life alot easier. Simply use the plugin to calculate into an auto-entered calculation field. ------------------ =-=-=-=-=-=-=-=-=-=-=-=-= Kurt Knippel Consultant Database Resources mailto:[email protected] http://www.database-resources.com =-=-=-=-=-=-=-=-=-=-=-=-= Link to comment Share on other sites More sharing options...
LiveOak Posted March 22, 2001 Share Posted March 22, 2001 Now you mention web access! I'll have to go with Kurt's idea. -bd Link to comment Share on other sites More sharing options...
elvis_impersonating_penguin Posted March 22, 2001 Author Share Posted March 22, 2001 ok.. nifty nifty, looks like fun.. one question how would i get that script to run every time a new record is created??? there might be a problem with this though.. the records are created through a web interface and scripts are somtimes un reliable when run through web interfaces. Link to comment Share on other sites More sharing options...
elvis_impersonating_penguin Posted March 22, 2001 Author Share Posted March 22, 2001 well what i am doing this for isn't all that important. not really worth putting the money into to buy a plugin.. and i am pretty good at finding ways around the impossible. You just have to remember, there is no spoon. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 8459 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 accountSign in
Already have an account? Sign in here.
Sign In Now