Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 7265 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I want to auto-enter a number value based on if a date falls with a specific date range.

For instance, if the date is between July 1, 1980 and June 30, 1990, the value should be $25.00, if the date is between July 1, 1970 and June 30, 1980, the value should be $20.00, etc, etc.

I tried this, but it doesn't seem to work (v_Date is the variable) :

Case ( v_Date ? "7/1/1980" and v_Date ? "6/30/1990", "25.00",

v_Date ? "7/1/1970" and v_Date ? "6/30/1980", "20.00")

Also, does it matter if v_Date is a global field or not?

-Scott

Posted

I want to auto-enter a number value based on if a date falls with a specific date range.

For instance, if the date is between July 1, 1980 and June 30, 1990, the value should be $25.00, if the date is between July 1, 1970 and June 30, 1980, the value should be $20.00, etc, etc.

I tried this, but it doesn't seem to work (v_Date is the variable) :

Case ( v_Date ? "7/1/1980" and v_Date ? "6/30/1990", "25.00",

v_Date ? "7/1/1970" and v_Date ? "6/30/1980", "20.00")

Also, does it matter if v_Date is a global field or not?

-Scott

Posted

I want to auto-enter a number value based on if a date falls with a specific date range.

For instance, if the date is between July 1, 1980 and June 30, 1990, the value should be $25.00, if the date is between July 1, 1970 and June 30, 1980, the value should be $20.00, etc, etc.

I tried this, but it doesn't seem to work (v_Date is the variable) :

Case ( v_Date ? "7/1/1980" and v_Date ? "6/30/1990", "25.00",

v_Date ? "7/1/1970" and v_Date ? "6/30/1980", "20.00")

Also, does it matter if v_Date is a global field or not?

-Scott

Posted

Auto enter happens when a record is created. Try making this a calculated field. I assume the ?'s are >= & <=. Also your numbers should not be in quotes and the trailing zeros are unnecessary.

Posted

Auto enter happens when a record is created. Try making this a calculated field. I assume the ?'s are >= & <=. Also your numbers should not be in quotes and the trailing zeros are unnecessary.

Posted

Auto enter happens when a record is created. Try making this a calculated field. I assume the ?'s are >= & <=. Also your numbers should not be in quotes and the trailing zeros are unnecessary.

Posted

I eliminated the quotes and made it a calculated field, and it still doesn't work. Any other thoughts?

Also, here's the current calc:

Case ( v_Date >= 7/1/1980 and v_Date <= 6/30/1990, "25",

v_Date >= "7/1/1970" and v_Date <= "6/30/1980", "20" )

-Scott

Posted

I eliminated the quotes and made it a calculated field, and it still doesn't work. Any other thoughts?

Also, here's the current calc:

Case ( v_Date >= 7/1/1980 and v_Date <= 6/30/1990, "25",

v_Date >= "7/1/1970" and v_Date <= "6/30/1980", "20" )

-Scott

Posted

I eliminated the quotes and made it a calculated field, and it still doesn't work. Any other thoughts?

Also, here's the current calc:

Case ( v_Date >= 7/1/1980 and v_Date <= 6/30/1990, "25",

v_Date >= "7/1/1970" and v_Date <= "6/30/1980", "20" )

-Scott

Posted

Try this.

Case( v_Date >= TextToDate("07/01/1980") and v_Date <= TextToDate("06/30/1990") , 25, v_Date >= TextToDate("07/01/1970") and v_Date <= TextToDate("06/30/1980"), 20)

Posted

Try this.

Case( v_Date >= TextToDate("07/01/1980") and v_Date <= TextToDate("06/30/1990") , 25, v_Date >= TextToDate("07/01/1970") and v_Date <= TextToDate("06/30/1980"), 20)

Posted

Try this.

Case( v_Date >= TextToDate("07/01/1980") and v_Date <= TextToDate("06/30/1990") , 25, v_Date >= TextToDate("07/01/1970") and v_Date <= TextToDate("06/30/1980"), 20)

Posted

Just to note, Date( 7, 1, 1980 ) is more reliable than TextToDate("7/1/1980") since it doesn't rely on system or regional settings.

Posted

Just to note, Date( 7, 1, 1980 ) is more reliable than TextToDate("7/1/1980") since it doesn't rely on system or regional settings.

Posted

Just to note, Date( 7, 1, 1980 ) is more reliable than TextToDate("7/1/1980") since it doesn't rely on system or regional settings.

Posted

Yes, that works! The winning calc is as follows:

Case( v_Date >= Date(7,1,1980) and v_Date <= Date(6,30,1990), "25",

v_Date >= Date(7,1,1970) and v_Date <= Date(6,30,1980), "20")

Thanks for all the responses,

-Scott

Posted

Yes, that works! The winning calc is as follows:

Case( v_Date >= Date(7,1,1980) and v_Date <= Date(6,30,1990), "25",

v_Date >= Date(7,1,1970) and v_Date <= Date(6,30,1980), "20")

Thanks for all the responses,

-Scott

Posted

Yes, that works! The winning calc is as follows:

Case( v_Date >= Date(7,1,1980) and v_Date <= Date(6,30,1990), "25",

v_Date >= Date(7,1,1970) and v_Date <= Date(6,30,1980), "20")

Thanks for all the responses,

-Scott

Posted

Note also that your numeric results need not be in quotes since they are not textual. It will not hurt if they are though.

Posted

Note also that your numeric results need not be in quotes since they are not textual. It will not hurt if they are though.

Posted

Note also that your numeric results need not be in quotes since they are not textual. It will not hurt if they are though.

This topic is 7265 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.