Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Calculation (text-resul) including date-field


Christof

Recommended Posts

I've created a calculation-field with a text-result as follow :

 

(° at "birthplace" on "dateofbirth")

 

now the field "dateofbirth" is a date-field, formatted as dd/mm/yyyy.

 

Now when I go to layout where is the calculation is shown its the dateofbirth-field in a strange way. Instead off, ex. 17/11/1976, it calculates this date als 712153. However when I change the dateofbirth-field into a text-field instead off date, the date is shown like it should be.

 

Is it normal that I can't use a date-field in a text-calculation or is there a way to adjust this calculation ?

 

Thx

Christof

Link to comment
Share on other sites

Hi Christof,

FileMaker stores dates as a number - literally the number of days from 1/1/0001 to the specified date (inclusive), so if you reference a date field, you get a large number.

 

One of the available ways to get around that is to use the DateToText( ) function, which will return the date field value as a standard date string (in the default system format). Or alternatively, if you want to 'get fancy', you can use the various other date functions to assemble a custom dateformat. Eg:

 

Day(dateofbirth) & " " & MonthName(dateofbirth) & " " & Year(dateofbirth)

 

Which will convert 712153 into "17 November 1976". cool.gif

Link to comment
Share on other sites

What do you want to do with the resultant calculated field? If you only need to display or print it, then use a merged field string like:

 

<<birthplace>> on <<dateofbirth>>

on your layout and format the whole text string (date) to whatever date format you want. Using merge fields also allows you to individually format the components - so birthplace could be in blue text and dateofbirth could be in italics...

 

If you need to export it - or email it, then Ray's solution is the way to go.

Link to comment
Share on other sites

Due to the fact that I'll need to email, export, print and display these items, I'm gone use Rays solution.

 

Russ, I'll keep youre solution in mind. Maybe I'm gone need it in future solutions.

 

Thx anyway

Christof

Link to comment
Share on other sites



×
×
  • Create New...

Important Information

Terms of Use