Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Add 30 days to Date
I need to add 30 or 45 days to the current date.
I've followed a few links, that for example add 301 days to a date I get the wrong date but it's not so noticable, it's off by a month or so, and if I add 30 days I get exactly 90 days out! Trying different inputs I get similar wrong dates. So, please test any link you send. TIA JeffP..... |
#2
|
|||
|
|||
Either run a macro when you have the cursor in the location where you want
the date to appear that contains the folloinwg code Selection.InsertBefore Format(DateAdd("d", 30, Date), "MMMM d, yyyy") or see http://www.wopr.com/cgi-bin/w3t/show...?Number=249902 -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "JDP@Work" wrote in message ... I need to add 30 or 45 days to the current date. I've followed a few links, that for example add 301 days to a date I get the wrong date but it's not so noticable, it's off by a month or so, and if I add 30 days I get exactly 90 days out! Trying different inputs I get similar wrong dates. So, please test any link you send. TIA JeffP..... |
#3
|
|||
|
|||
I'm so sorry, I forgot to mention that I use my documents as templates for an
automated process. The print function I use is similar to a right-click print in the file manager Windows Explorer. So, macros that depend on humans won't work. I've got some what of a solution. Originally I was asked to use the request date, however there are often delays in processing a request that is no fault of the client's, so I instead use the first printing date, then the first follow up and finally the the final follow up dates detecting only a true condition for each adding 15 days to the second request letter that is sent out 15 days after the first letter. But as noted some cases the second letter could have a delay and it will still give the client 15 days. Please complete the application by {if{appreqfu1)' ' {ddeauto appreqdt+30}\@ "MMMM d, yyyy"}{if{appreqfu1)' ' {ddeauto appreqfu1+15}\@ "MMMM d, yyyy"} Thanks to all.... JeffP..... "Doug Robbins" wrote in message ... Either run a macro when you have the cursor in the location where you want the date to appear that contains the folloinwg code Selection.InsertBefore Format(DateAdd("d", 30, Date), "MMMM d, yyyy") or see http://www.wopr.com/cgi-bin/w3t/show...?Number=249902 -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "JDP@Work" wrote in message ... I need to add 30 or 45 days to the current date. I've followed a few links, that for example add 301 days to a date I get the wrong date but it's not so noticable, it's off by a month or so, and if I add 30 days I get exactly 90 days out! Trying different inputs I get similar wrong dates. So, please test any link you send. TIA JeffP..... |
#4
|
|||
|
|||
If you are still monitoring this thread, I would be interested to know
exactly what the text in your ddeauto field is, and what kind of thing "appreqt" is. Thanks, Peter Jamieson "JDP@Work" wrote in message ... I'm so sorry, I forgot to mention that I use my documents as templates for an automated process. The print function I use is similar to a right-click print in the file manager Windows Explorer. So, macros that depend on humans won't work. I've got some what of a solution. Originally I was asked to use the request date, however there are often delays in processing a request that is no fault of the client's, so I instead use the first printing date, then the first follow up and finally the the final follow up dates detecting only a true condition for each adding 15 days to the second request letter that is sent out 15 days after the first letter. But as noted some cases the second letter could have a delay and it will still give the client 15 days. Please complete the application by {if{appreqfu1)' ' {ddeauto appreqdt+30}\@ "MMMM d, yyyy"}{if{appreqfu1)' ' {ddeauto appreqfu1+15}\@ "MMMM d, yyyy"} Thanks to all.... JeffP..... "Doug Robbins" wrote in message ... Either run a macro when you have the cursor in the location where you want the date to appear that contains the folloinwg code Selection.InsertBefore Format(DateAdd("d", 30, Date), "MMMM d, yyyy") or see http://www.wopr.com/cgi-bin/w3t/show...?Number=249902 -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "JDP@Work" wrote in message ... I need to add 30 or 45 days to the current date. I've followed a few links, that for example add 301 days to a date I get the wrong date but it's not so noticable, it's off by a month or so, and if I add 30 days I get exactly 90 days out! Trying different inputs I get similar wrong dates. So, please test any link you send. TIA JeffP..... |
#5
|
|||
|
|||
It is a date field from an MSSQL database that is passed as a dBase expression,
that when I add 30 is shows the date 30 days in advance. excerpt snipit... {if"{ddeauto goldmine data (contact2-uappreqfu1)}"' ' {ddeauto goldmine data contact2-uappreqfu1+15}\@"MMM d, yyyy"} You will notice that I have two similar fields, only one prints the date+30 or date+15 depending on the boolean of a date in the first followup field. I've gotten around my original problem by using my last printed dates and adding the appropriate remaining days. The only thing is; say a letter was printed 7 days ago, but for some reason it was wrong and was not sent out. I don't want my users having to find that record in the database, the QA person just does their task to set it to reprint and later that day it does. But it would add 30 or 15 days to the 7 days old last followup print date. What would be best is if I could add the correct days to the print date in the doc depending on if the last print date had a value, but not evaluate the date, just say yes or no and add 30 or the remaiing 15 days. TIA JeffP..... "Peter Jamieson" wrote in message ... If you are still monitoring this thread, I would be interested to know exactly what the text in your ddeauto field is, and what kind of thing "appreqt" is. Thanks, Peter Jamieson "JDP@Work" wrote in message ... I'm so sorry, I forgot to mention that I use my documents as templates for an automated process. The print function I use is similar to a right-click print in the file manager Windows Explorer. So, macros that depend on humans won't work. I've got some what of a solution. Originally I was asked to use the request date, however there are often delays in processing a request that is no fault of the client's, so I instead use the first printing date, then the first follow up and finally the the final follow up dates detecting only a true condition for each adding 15 days to the second request letter that is sent out 15 days after the first letter. But as noted some cases the second letter could have a delay and it will still give the client 15 days. Please complete the application by {if{appreqfu1)' ' {ddeauto appreqdt+30}\@ "MMMM d, yyyy"}{if{appreqfu1)' ' {ddeauto appreqfu1+15}\@ "MMMM d, yyyy"} Thanks to all.... JeffP..... "Doug Robbins" wrote in message ... Either run a macro when you have the cursor in the location where you want the date to appear that contains the folloinwg code Selection.InsertBefore Format(DateAdd("d", 30, Date), "MMMM d, yyyy") or see http://www.wopr.com/cgi-bin/w3t/show...?Number=249902 -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "JDP@Work" wrote in message ... I need to add 30 or 45 days to the current date. I've followed a few links, that for example add 301 days to a date I get the wrong date but it's not so noticable, it's off by a month or so, and if I add 30 days I get exactly 90 days out! Trying different inputs I get similar wrong dates. So, please test any link you send. TIA JeffP..... |
#6
|
|||
|
|||
Hi JeffP,
Thanks for the clarification re. DDEAUTO. There are a couple of other possible approaches to this but since it seems you have found one that works I wouln't be inclined to touch it. Re. the business of reprinting stuff, I suspect I have not fully understood but can only suggest that a. once /Word/ thinks you have printed, and the document is saved, the document is going to contain the date Word thought you had printed it on. It doesn't know that someone threw the thing in the bin. b. so I suspect what really needs to change is the procedure - i.e., someone has to start slightly further back in the process and do a "re-merge", rather than just doing a "reprint". Peter Jamieson "JDP@Work" wrote in message ... It is a date field from an MSSQL database that is passed as a dBase expression, that when I add 30 is shows the date 30 days in advance. excerpt snipit... {if"{ddeauto goldmine data (contact2-uappreqfu1)}"' ' {ddeauto goldmine data contact2-uappreqfu1+15}\@"MMM d, yyyy"} You will notice that I have two similar fields, only one prints the date+30 or date+15 depending on the boolean of a date in the first followup field. I've gotten around my original problem by using my last printed dates and adding the appropriate remaining days. The only thing is; say a letter was printed 7 days ago, but for some reason it was wrong and was not sent out. I don't want my users having to find that record in the database, the QA person just does their task to set it to reprint and later that day it does. But it would add 30 or 15 days to the 7 days old last followup print date. What would be best is if I could add the correct days to the print date in the doc depending on if the last print date had a value, but not evaluate the date, just say yes or no and add 30 or the remaiing 15 days. TIA JeffP..... "Peter Jamieson" wrote in message ... If you are still monitoring this thread, I would be interested to know exactly what the text in your ddeauto field is, and what kind of thing "appreqt" is. Thanks, Peter Jamieson "JDP@Work" wrote in message ... I'm so sorry, I forgot to mention that I use my documents as templates for an automated process. The print function I use is similar to a right-click print in the file manager Windows Explorer. So, macros that depend on humans won't work. I've got some what of a solution. Originally I was asked to use the request date, however there are often delays in processing a request that is no fault of the client's, so I instead use the first printing date, then the first follow up and finally the the final follow up dates detecting only a true condition for each adding 15 days to the second request letter that is sent out 15 days after the first letter. But as noted some cases the second letter could have a delay and it will still give the client 15 days. Please complete the application by {if{appreqfu1)' ' {ddeauto appreqdt+30}\@ "MMMM d, yyyy"}{if{appreqfu1)' ' {ddeauto appreqfu1+15}\@ "MMMM d, yyyy"} Thanks to all.... JeffP..... "Doug Robbins" wrote in message ... Either run a macro when you have the cursor in the location where you want the date to appear that contains the folloinwg code Selection.InsertBefore Format(DateAdd("d", 30, Date), "MMMM d, yyyy") or see http://www.wopr.com/cgi-bin/w3t/show...?Number=249902 -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "JDP@Work" wrote in message ... I need to add 30 or 45 days to the current date. I've followed a few links, that for example add 301 days to a date I get the wrong date but it's not so noticable, it's off by a month or so, and if I add 30 days I get exactly 90 days out! Trying different inputs I get similar wrong dates. So, please test any link you send. TIA JeffP..... |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Calculate a date from days date | Microsoft Word Help | |||
add days to the current date. | Microsoft Word Help | |||
How do I insert a current date in a template and then keep this i. | Microsoft Word Help | |||
How to insert future date based on current date plus 14 days | Microsoft Word Help | |||
In Word, any way to add 120 days to a merged date? | Mailmerge |