dbTalk Databases Forums  

Determine if a date or month exists in a field

comp.databases.filemaker comp.databases.filemaker


Discuss Determine if a date or month exists in a field in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
actionman007
 
Posts: n/a

Default Determine if a date or month exists in a field - 04-25-2007 , 11:47 AM






How can I check if a specific date or month exists in a field, if it
does then put a "X" in a corresponding field?

Cheers.


Reply With Quote
  #2  
Old   
Ursus
 
Posts: n/a

Default Re: Determine if a date or month exists in a field - 04-25-2007 , 01:06 PM







"actionman007" <actionman007 (AT) gmail (DOT) com> schreef in bericht
news:1177519657.544356.42570 (AT) c18g2000prb (DOT) googlegroups.com...
Quote:
How can I check if a specific date or month exists in a field, if it
does then put a "X" in a corresponding field?

Cheers.

Your question is very vague, what kind of field is the date or month. Is it
a textfield with heaps of text?
(use the patterncount and the date functions together)
or just a plain date field?
( a plain if A = B would suffice)

Keep well, Ursus




Reply With Quote
  #3  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Determine if a date or month exists in a field - 04-25-2007 , 03:59 PM



In article <1177519657.544356.42570 (AT) c18g2000prb (DOT) googlegroups.com>,
actionman007 <actionman007 (AT) gmail (DOT) com> wrote:

Quote:
How can I check if a specific date or month exists in a field, if it
does then put a "X" in a corresponding field?

Cheers.
For consistency sake I've used the American MM/DD/YY order. If you're
using a system with the English DD/MM/YY order you can simply swap all
the Month and Day numbers ... EXCEPT in the case of the Date function
below.


No doubt what you've already tried to do is use something like:

If (DateField = "4/1/2007", "X", "")

But this compares the DateField to a the TEXT value of "4/1/2007",
which makes no sense - even if the DateFiel does contain the date
4/1/2007 it doesn't match the text value of "4/1/2007".

Instead you have to convert your text value into a proper date value.
eg.

If(DateField = Date("4", "1", "2007"), "X", "")

Note: The Date function only accepts it's parameters in American MM,
DD, YY order. \

or

If (DateField = TextToDate("4/1/2007"), "X", "")



If you want just the Month, then you can use the Month function,
eg.
If (Month(DateField) = "4", "X", "")

or the MonthName function.
eg.
If (MonthName(DateField) = "April", "X", "")



Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
  #4  
Old   
d-42
 
Posts: n/a

Default Re: Determine if a date or month exists in a field - 04-26-2007 , 01:55 AM



On Apr 25, 9:47 am, actionman007 <actionman... (AT) gmail (DOT) com> wrote:
Quote:
How can I check if a specific date or month exists in a field, if it
does then put a "X" in a corresponding field?

Cheers.
define the second field as a calculation such that:

if (dateFieldA = GetAsDate("3/3/2006"), "X","")

you can compare dateFieldA to another date field, or an 'on the fly'
calculation instead of a hardcoded value of course...

If you just want to test for a specific month

if (Month(dateFieldA)=7, "X","")

Where 7 is August...etc...

That should point you in the right direction...

-cheers,
Dave



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.