Jump to content

Text Calc to a Date field


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

Recommended Posts

Hi

I am in the process of converting my FM6 databases to FM9. I was used to use date strings to get sale reports for a specific time period. I had to replace Today by Status (CurrentDate). For example, I use this calc string to perform a search for the previous month.

DateToText(Date(Month(Status ( CurrentDate )) - 1; 1; Year(Status ( CurrentDate )))) & "..." & DateToText(Date(Month(Status ( CurrentDate )); 1; Year(Status ( CurrentDate ))) - 1)

The result is 09/01/2007...09/31/2007

When I use the above string with a Set Field command, the result is not what expected because the Date field is in date format. So, I need to change the string in order to make it work with a Set Field command.

Any suggestion is welcome

Link to comment
Share on other sites

You can use Insert Calculated Result [your calculation]. It mimics the user actually typing. Hence the date field has to be on the layout. You will find that later versions of FileMaker are much more forgiving and flexible about date Finds. You CAN use Set Field in later versions, and the date field does not need to be on the layout; this will work:

Enter Find Mode []

Set Field [ Date_; GetAsText ( Get (CurrentDate)) & ".." & GetAsText ( Get (CurrentDate) + 1) ]

Perform Find []

As will:

Set Field [ Date_; ">" & GetAsText ( Get (CurrentDate)) ]

Link to comment
Share on other sites

This topic is 6086 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.