dbTalk Databases Forums  

Date

comp.databases.filemaker comp.databases.filemaker


Discuss Date in the comp.databases.filemaker forum.



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

Default Date - 11-09-2010 , 05:44 PM






FM8.5

I want to create a calculation result with a parameter , Create Date
is more recent than September 29, 2010. Would this be Create_Date >
29/09/2010?
My calculation is:

Account_Date_Create > 29/9/2010 and CONTACTS::CountryCompany =
"Canada" and CONTACTS::StateCompany = "AB" or "Alberta"; Net * .05

Do you see any problems. Currently this calc is not discriminating
against Create Dates earlier than Sept 29.
Thanks

Reply With Quote
  #2  
Old   
Your Name
 
Posts: n/a

Default Re: Date - 11-09-2010 , 06:14 PM






In article
<3dde5ad1-bb3c-4220-8e0f-0ebcfdd92096 (AT) 37g2000prx (DOT) googlegroups.com>,
Buckbuck <buck.matthew74 (AT) yahoo (DOT) com> wrote:

Quote:
FM8.5

I want to create a calculation result with a parameter , Create Date
is more recent than September 29, 2010. Would this be Create_Date
29/09/2010?
My calculation is:

Account_Date_Create > 29/9/2010 and CONTACTS::CountryCompany =
"Canada" and CONTACTS::StateCompany = "AB" or "Alberta"; Net * .05

Do you see any problems. Currently this calc is not discriminating
against Create Dates earlier than Sept 29.
Thanks
There's two problems here.

Firstly, when performing multiple tests in an If or Case statment you MUST
put brackets / parentheses around each individual test to ensure that they
are performed as you want them to be.

Secondly you've got an extra "or "Alberta"" which makes no sense by itself
- there should always be a Field name. I'm guessing that's meant to test
if the StateCompany Field contains the data "AB" or the data "Alberta".

This means you calculatio, which performs three tests (one of which
combines two sub-tests) should really be written as:

(Account_Date_Create > 29/9/2010)
and (CONTACTS::CountryCompany = "Canada")
and ((CONTACTS::StateCompany = "AB") or (CONTACTS::StateCompany =
"Alberta"));
Net * .05

They don't have to be on separate lines, but it does make it easier to see
where the separate test are.

Helpful Harry )

Reply With Quote
  #3  
Old   
Buckbuck
 
Posts: n/a

Default Re: Date - 11-09-2010 , 10:27 PM



On Nov 9, 4:14Â*pm, your.n... (AT) isp (DOT) com (Your Name) wrote:
Quote:
In article
3dde5ad1-bb3c-4220-8e0f-0ebcfdd92... (AT) 37g2000prx (DOT) googlegroups.com>,

Buckbuck <buck.matthe... (AT) yahoo (DOT) com> wrote:
FM8.5

I want to create a calculation result with a parameter , Create Date
is more recent than September 29, 2010. Would this be Create_Date
29/09/2010?
My calculation is:

Account_Date_Create > 29/9/2010 and CONTACTS::CountryCompany =
"Canada" and CONTACTS::StateCompany = "AB" or "Alberta"; Net * .05

Do you see any problems. Currently this calc is not discriminating
against Create Dates earlier than Sept 29.
Thanks

There's two problems here.

Firstly, when performing multiple tests in an If or Case statment you MUST
put brackets / parentheses around each individual test to ensure that they
are performed as you want them to be.

Secondly you've got an extra "or "Alberta"" which makes no sense by itself
- there should always be a Field name. I'm guessing that's meant to test
if the StateCompany Field contains the data "AB" or the data "Alberta".

This means you calculatio, which performs three tests (one of which
combines two sub-tests) should really be written as:

Â* Â* Â* Â*(Account_Date_Create > 29/9/2010)
Â* Â*and (CONTACTS::CountryCompany = "Canada")
Â* Â*and ((CONTACTS::StateCompany = "AB") or (CONTACTS::StateCompany =
"Alberta"));
Â* Â* Net * .05

They don't have to be on separate lines, but it does make it easier to see
where the separate test are.

Helpful Harry Â*)
Based on your help I created this series of tests. But it did not
work.. Can anyone see why

Case
(

(Account_Date_Create > 29/9/2010) and
(CONTACTS::CountryCompany = "Canada") and
((CONTACTS::StateCompany = "AB") or (CONTACTS::StateCompany =
"Alberta"))
;.05;

(Account_Date_Create > 29/9/2010) and
(CONTACTS::CountryCompany = "Canada") and
((CONTACTS::StateCompany = "BC") or (CONTACTS::StateCompany = "British
Columbia")) and
(Submit taxes â‰* "No")
;.12;

(Account_Date_Create > 29/9/2010) and
(CONTACTS::CountryCompany = "Canada") and
((CONTACTS::StateCompany = "NS") or (CONTACTS::StateCompany = "Nova
Scotia"))
;.05;

(Account_Date_Create > 29/9/2010) and
(CONTACTS::CountryCompany = "Canada") and
((CONTACTS::StateCompany = "MB") or (CONTACTS::StateCompany =
"Manitoba"))
;.05;

(Account_Date_Create > 29/9/2010) and
(CONTACTS::CountryCompany = "Canada") and
((CONTACTS::StateCompany = "ON") or (CONTACTS::StateCompany =
"Ontario"))
;.05 ;

(Account_Date_Create > 29/9/2010) and
(CONTACTS::CountryCompany = "Canada") and
((CONTACTS::StateCompany = "QB") or (CONTACTS::StateCompany =
"Quebec"))
; .05 ;

(Account_Date_Create > 29/9/2010) and
(CONTACTS::CountryCompany = "Canada") and
((CONTACTS::StateCompany = "SA") or (CONTACTS::StateCompany =
"Saskatchewan"))
; .05 ;

(Account_Date_Create > 29/9/2010) and
(CONTACTS::CountryCompany â‰* "Canada") and
(CountryCompany_s = "Canada")
; .05

; 0

)

Reply With Quote
  #4  
Old   
Your Name
 
Posts: n/a

Default Re: Date - 11-09-2010 , 11:42 PM



"Buckbuck" <buck.matthew74 (AT) yahoo (DOT) com> wrote

Quote:
Based on your help I created this series of tests. But it did not
work.. Can anyone see why

Case
(

(Account_Date_Create > 29/9/2010) and
(CONTACTS::CountryCompany = "Canada") and
((CONTACTS::StateCompany = "AB") or (CONTACTS::StateCompany =
"Alberta"))
;.05;

(Account_Date_Create > 29/9/2010) and
(CONTACTS::CountryCompany = "Canada") and
((CONTACTS::StateCompany = "BC") or (CONTACTS::StateCompany =
"British Columbia")) and
(Submit taxes ? "No")
;.12;

(Account_Date_Create > 29/9/2010) and
(CONTACTS::CountryCompany = "Canada") and
((CONTACTS::StateCompany = "NS") or (CONTACTS::StateCompany =
"Nova Scotia"))
;.05;

(Account_Date_Create > 29/9/2010) and
(CONTACTS::CountryCompany = "Canada") and
((CONTACTS::StateCompany = "MB") or (CONTACTS::StateCompany =
"Manitoba"))
;.05;

(Account_Date_Create > 29/9/2010) and
(CONTACTS::CountryCompany = "Canada") and
((CONTACTS::StateCompany = "ON") or (CONTACTS::StateCompany =
"Ontario"))
;.05 ;

(Account_Date_Create > 29/9/2010) and
(CONTACTS::CountryCompany = "Canada") and
((CONTACTS::StateCompany = "QB") or (CONTACTS::StateCompany =
"Quebec"))
; .05 ;

(Account_Date_Create > 29/9/2010) and
(CONTACTS::CountryCompany = "Canada") and
((CONTACTS::StateCompany = "SA") or (CONTACTS::StateCompany =
"Saskatchewan"))
; .05 ;

(Account_Date_Create > 29/9/2010) and
(CONTACTS::CountryCompany ? "Canada") and
(CountryCompany_s = "Canada")
; .05

; 0

)
Sorry, there's one other problem I overlooked before ... you can't perform a
date comparison as:

Account_Date_Create > 29/9/2010

Filemaker will see the / symbols as division operators, meaning the data in
the Field Account_Date_Create will be compared to the number 0.0016030...
(i.e. 29 divided by 9 divided by 2010).

The best and easiest way to solve this would be to create a Global Field (of
type Date).
e.g.
g_ComparisonDate Global, Date

Put that Field onto any Layout temporarily and type in the date "29/9/2010".
Then you can use that Field in place of all the dates in the calculation.
e.g.
Case
(
(Account_Date_Create > g_ComparisonDate) and
(CONTACTS::CountryCompany = "Canada") and
((CONTACTS::StateCompany = "AB") or (CONTACTS::State
Company = "Alberta"))
;.05;

(Account_Date_Create > g_ComparisonDate) and
(CONTACTS::CountryCompany = "Canada") and
((CONTACTS::StateCompany = "BC") or (CONTACTS::State
Company = "British Columbia")) and
(Submit taxes ? "No")
;.12;
etc.


Helpful Harry )

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.