Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.newusers
|
|||
|
|||
Form Field Date Comparison
In Word 2007, I have a form with fields. I have the user enter a date in
Field1 and then want Field2 to do certain things based on whether the date in Field1 is greater than a static date. I read a great example from Graham Mayor that works, but when I try to change the date format from the example, it won't work. Works: Format Field1 as a yyyyMMdd date Field2: =If (Field1 \@ "yyyyMMdd" 20080701, 1, 2) This is great, but it makes Field1 show up as 20081210, when I would like it to show up as 12/10/08. Is there a way to do a date comparison and still have Field1 display a date in the M/D/YY format? Thanks for any help! |
#2
Posted to microsoft.public.word.newusers
|
|||
|
|||
Form Field Date Comparison
Hi Jean,
You could leave Field1 in 'D M YYYY' format or 'M D YYYY' format (or whichever variant of those you prefer. You could then use a formula field (not a formfield) to do the comparison using the following syntax: {IF{Field1 \@ YYYYMMDD} 20080701 "1" "2"} Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste them from this message. -- Cheers macropod [MVP - Microsoft Word] "Jean D" wrote in message ... In Word 2007, I have a form with fields. I have the user enter a date in Field1 and then want Field2 to do certain things based on whether the date in Field1 is greater than a static date. I read a great example from Graham Mayor that works, but when I try to change the date format from the example, it won't work. Works: Format Field1 as a yyyyMMdd date Field2: =If (Field1 \@ "yyyyMMdd" 20080701, 1, 2) This is great, but it makes Field1 show up as 20081210, when I would like it to show up as 12/10/08. Is there a way to do a date comparison and still have Field1 display a date in the M/D/YY format? Thanks for any help! |
#3
Posted to microsoft.public.word.newusers
|
|||
|
|||
Form Field Date Comparison
I don't recall suggesting that you should format Field1 as yyyyMMdd? It is
in the conditional field where it needs to be so formatted. Field1 can use any valid date format you require at the point of its display. See http://www.gmayor.com/formatting_word_fields.htm If thgis is a protected form and Field1 is a text form field with its properties set as Date with the format M/d/yy (or d/M/yy) then the second field should be a Word field combination (not a form field) { If { Field1 \@ "yyyyMMdd" } 20080701 1 2 } or { If { Field1 \@ "yyyyMMdd" } 20080701 "1" "2" } -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Jean D wrote: In Word 2007, I have a form with fields. I have the user enter a date in Field1 and then want Field2 to do certain things based on whether the date in Field1 is greater than a static date. I read a great example from Graham Mayor that works, but when I try to change the date format from the example, it won't work. Works: Format Field1 as a yyyyMMdd date Field2: =If (Field1 \@ "yyyyMMdd" 20080701, 1, 2) This is great, but it makes Field1 show up as 20081210, when I would like it to show up as 12/10/08. Is there a way to do a date comparison and still have Field1 display a date in the M/D/YY format? Thanks for any help! |
#4
Posted to microsoft.public.word.newusers
|
|||
|
|||
Form Field Date Comparison
Thank you both for your help! This works perfectly. I now see that I am
having a newbie confusion between calculated form fields and formula fields. They seemed to have the same functionality, but now I am beginning to see that they don't. I also realize now that this confustion caused me to misread your (Graham) example that I found earlier. I'll see if I can find any reference to help me understand when to use one or the other. Thank you both again so much! J. On Thu, 11 Dec 2008 08:21:35 +0200, Graham Mayor wrote: From: "Graham Mayor" References: Subject: Form Field Date Comparison Date: Thu, 11 Dec 2008 08:21:35 +0200 Lines: 41 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-RFC2646: Format=Flowed; Original Message-ID: Newsgroups: microsoft.public.word.newusers NNTP-Posting-Host: 213-209-106.netrun.cytanet.com.cy 213.7.209.106 Path: news.qwest.net!mpls-num-01.inet.qwest.net!mpls-txt-01.inet.qwest.net!feed.news.qwest.net!mpls-nntp-02.inet.qwest.net!news.ecp.fr!feeder.erje.net!news feed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!TK2MSFTFEEDS02.phx.gbl!TK2MSFTNGP01.phx. gbl!TK2MSFTNGP04.phx.gbl Xref: news.qwest.net microsoft.public.word.newusers:25570 I don't recall suggesting that you should format Field1 as yyyyMMdd? It is in the conditional field where it needs to be so formatted. Field1 can use any valid date format you require at the point of its display. See http://www.gmayor.com/formatting_word_fields.htm If thgis is a protected form and Field1 is a text form field with its properties set as Date with the format M/d/yy (or d/M/yy) then the second field should be a Word field combination (not a form field) { If { Field1 \@ "yyyyMMdd" } 20080701 1 2 } or { If { Field1 \@ "yyyyMMdd" } 20080701 "1" "2" } |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Form Field of Date Type Not Keeping Month Portion Of Date | Microsoft Word Help | |||
Date field in form | Microsoft Word Help | |||
Use current date in the default date form field option | Microsoft Word Help | |||
I want a form field to figure a date based on the letter date. | Microsoft Word Help | |||
Date comparison inconsistency | Mailmerge |