let ( today = get ( currentdate ); "WSC" & month ( today ) & day ( today ) & year ( today ) & ".fp7" )
I can 'format' the file name in a field....but what does the Export look like to get the records exported and named as i want them named?... sorry to be so dense...
Set Varible $TodayFileName value =Let ( today =Get ( CurrentDate ) ; "WSC" & Year ( today ) & Month ( today ) & Day ( today ) & ".fp7" )
Save Copy As ( $TodayFileName ; Copy Of Current File)
This will Name it WSC and YYYYMMDD
However month and days with only one digit will not show zero
Let ( today =Get ( CurrentDate ) ; "WSC" & Year ( today ) & Right ( "0" & Month ( today ) ; 2 ) & right ( "0" & Day ( today ) ; 2 ) & ".fp7" )
Will provide leading zeroes for single digit month, day numbers.
Thank you for your post.
The answer provided by "etripoli" assumes that you would be exporting from a script. If you are doing this manually each time, you may want to consider creating a script so that you don't have to manually set the file name each time.
1. Pull down the Scripts menu and select "Manage Scripts..."
2. Click the "New" icon in the bottom left corner.
3. Enter the "Script Name:" Daily Output
4. The left side of the screen contains a listing of available script commands. Select "Set Variable"
5. On the right side, you will now see "Set Variable  " Below that, in the bottom right area, click on "Specify..."
6. Enter into Name: $file
7. To the right of Value:, click "Specify..."
8. Enter the following formula:
Let ( today = Get ( CurrentDate ) ; "file:" & Get ( DesktopPath ) & "WSC" & Right ( "0" & Month ( today ) ; 2 ) & Right ( "0" & Day ( today ) ; 2 ) & Right ( Year ( today ) ; 2 ) & ".fp7" )
10. On the left side, scroll down until you find "Export Records" and double-click on it.
11. On the right side, you will see "Export Records  "
12. Check the option to "Perform without dialog".
13. Check the option "Specify output file", and you will be taken to a new screen.
14. In the large white area, enter: $file
15. For File Type: select "FileMaker Pro"
16. Click OK.
17. Check the option "Specify export order", and another dialog box appears.
18. Assuming you want all fields exported, click on "Move All" and click OK.
19. Close the script and you will be prompted to save it. Do so.
20. Execute the script, and a FileMaker file WSCmmddyy.fp7 (with today's date) will be exported to the Desktop.
Let me know if you need clarification for any of the above steps.
I like PhilModJunk's solution to keeping the dates two digit. Better than using 'SerialIncrement', as I had in the past. And TSGal is right, we're assuming you're using a script, because that gives the ultimate short-cut.
Many thanks to all of you for your help (I've been putzing with this for hours!!), and a special thanks to TSGal for the nicely detailed explanation... it provided the missing tweeks to my script.
again, many, many thanks to you all!
Better than using 'SerialIncrement', as I had in the past.
Hmm, it's a toss-up. Much cleaner than my version, in any case. I wonder if SerialIncrement is more processor intensive than Right?
I don't know (and don't care much). I'd guess evaluating SerialIncrement() once should be more efficient than evaluating Left() three times... not to mention that SerialIncrement() is a function written specifically for this purpose. But if you're really bothered, do some tests.
Once the first record is set as PhilModJunk suggests, as a two digit number with leading zero if necessary, SerialIncrement will do what's expected, even if stored as text . . . 01 will increment to 02 etc. I've just tested it on something I was doing and it works.