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

How to create Birthday list from DOB field, based on global date field plus 15 days


dave8952
 Share

Recommended Posts

I have searched high & low for a solution, and can't find the exact way to do this. I would think that someone has done this before.

 

I have a Member Directory, with a DOB field. What I would like to do, is to have a global date field, where I enter a "Starting Date", and then a layout that would give me a list of birthdays that start at the Start Date, plus 15 days, so that I get a month and a half of bdays.

 

The problem seems to be in these issues:

  1. Getting "Jan 01" (formatted this way) from the DOB field
  2. Then sorting the list by dates, instead of text
  3. Then having a text list of all the bdays, that I could copy and paste into my website.

 

I've tried a lot of ways suggested, but nothing seems to get me what I need. Can anyone help me with this?

 

Thanks, Dave

Link to comment
Share on other sites

 

The problem seems to be in these issues:

Getting "Jan 01" (formatted this way) from the DOB field

Calculation field, result type "text", defined as:

MonthName (DOB)&" " & Right ("0" & Day (DOB), 2)

Then sorting the list by dates, instead of text

Sort [ascending, by DOB, no dialog]

Then having a text list of all the bdays, that I could copy and paste into my website.

Set Variable [$ExportPath; Get(DesktopPath)&"Birthdays.txt"]

Export Records [$ExportPath, no dialog, as tab delim text, YourTable::DOB, automatically open]

Link to comment
Share on other sites

Hi Ahunter3,

 

Thanks for the really quick reply - I don't usually see that on Forums!!

 

 

Calculation field, result type "text", defined as:

MonthName (DOB)&" " & Right ("0" & Day (DOB), 2)

 

Got that one - thanks.

 

Sort [ascending, by DOB, no dialog]

 

If I sort by DOB, it takes the year into account, and not simply sorting by month & day.

 

Set Variable [$ExportPath; Get(DesktopPath)&"Birthdays.txt"]

Export Records [$ExportPath, no dialog, as tab delim text, YourTable::DOB, automatically open]

 

Is this section a script? Like an "Export" script?

 

Thanks again for your help, sometimes my mind just quits on me with this stuff!

Edited by dave8952
fixing grammer
Link to comment
Share on other sites

 

If I sort by DOB, it takes the year into account, and not simply sorting by month & day.

 

 

Oh. Create a SECOND calc field, result type "number", defined as Year (DOB) & Right ("0" & Month (DOB); 2) Call it BirthdayYrMo. Sort by that.

 

(Values will look like 201601, 201603, 201610, and so forth.)

 

Is this section a script? Like an "Export" script?

 

 

Yeah, an Export script to yield the list of birthdays for copy-and-paste purposes.

 

If you want the exported birthdays to be the month and days, export that field instead. Either way, you can just do a select all and copy from the exported text file and you're good to paste them elsewhere.

Link to comment
Share on other sites

Ooops, I'm not getting the "Set Variable" part (I understand the Export part).

 

Here's what I've got:

 

Set Variable [$ExportPath; Value:Get (DesktopPath) & "Birthdays.txt" ]

 

I think it's the "Value" part that's wrong, is that right? I guess I'm not understanding how this gets called, as nothing happens separate from the Export section.

 

Thanks, Dave

Link to comment
Share on other sites

You've got the value part correct if you've put what you're saying you've put.

 

What isn't working?

 

I gather that you're confused but I'm confused about what you're confused about.

Link to comment
Share on other sites

I'm confused about what that step is actually doing, because:

 

1. when I go thru the Export step, the name (Birthdays.txt) doesn't come up in the Save As box

 

2. I'm not sure what the Get(DesktopPath) is actually doing. Do I store that somewhere/somehow?

 

Sorry for my lack of understanding on some of the "less obvious" functions. And thanks for your help!

Link to comment
Share on other sites

There should not BE a Save As dialog box because you should be exporting without a dialog. Check the "no dialog" option.

 

Get (DesktopPath) is a "Get" function. Once upon a time they were called "Status" functions (and were written that way: Status (CurrentDesktopPath) and so forth). FileMaker evaluates them based on your current context. If you're on a Mac and your MacOS username is "dave8952" and your startup disk is (still) called "Macintosh HD", the value of Get (DesktopPath) is /Macintosh HD/Users/dave8952/Desktop/.

 

Setting the variable $ExportPath to Get(DesktopPath) & "birthdays.txt" should mean that $ExportPath resolves to /Macintosh HD/Users/dave8952/Desktop/Birthdays.txt. (Or, more formally, filemac:///Macintosh HD/Users/dave8952/Desktop/Birthdays.txt —*FileMaker is smart enough to know to treat it as a filepath. At least on the Mac :P

 

You can export to a hardwired filepath (like "filemac:///ExternalDrive/Stuff/myfile.txt") or to a $Variable (like $ExportPath) in the Export Records script step, but not to a formula (like Get(DesktopPath) & "birthdays.txt") so you have to first set the $Variable so that the entire filepath-string is in it, then you export to the $Variable as the "specify file" part of the Export Records script step.

 

 

 

 

By the way, the constraints on Export Records described above also apply to Import paths, Save Records as PDF, and several other places where a file path is needed.

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

Terms of Use