3 Replies Latest reply on Mar 29, 2016 8:56 AM by mjbenun

    Problem with Get(CurrentDate)

    mjbenun

      I have a script that saves an Excel File to my Desktop.

       

      The following line in my script is used to set the naming convention:

      StyleMaster::Factory &" "&  " ShipSchedule" & Get(CurrentDate)

       

      I want this to output FactoryName ShipsSchedule Todays Date, but I am getting an error message regarding the date.

      When I remove the Get(CurrentDate) parameter the script works fine and I get “Factory Name ShipSchedule” .  I can’t figure out why the Get command is messing things up- but I have a feeling it has to do with Excel not being able to accept the way the Date is formatted..

       

      Please help.  Thanks!

       

        • 1. Re: Problem with Get(CurrentDate)
          erolst

          Excel has nothing to with this – the error is thrown from your OS, which probably is unhappy about certain characters in the textual representation of the date (namely, the slash).

           

          Try

           

          StyleMaster::Factory & " " & " ShipSchedule" & Substitute ( Get ( CurrentDate ) ; "/" ; "_" )

          • 2. Re: Problem with Get(CurrentDate)
            JesseH

            mjbenum,

            My guess is the "Date" would look something like this "3/29/2016", file names don't like the "/" symbol in them. You will need to change the date format in your calculation

            For example,

            Year(Get(CurrentDate)) [will produce 2016]  & Day(Get(CurrentDate)) [will produce 29 ]


            End result is 201629

            * You may need to switch "Year" and "Get" in the calculation, I can't remember which way Filemaker likes that calculation set up. Then you can add hyphens where needed and change the date order however you choose.

             

            Jesse

             

            edit: erolst has the right idea.

            • 3. Re: Problem with Get(CurrentDate)
              mjbenun

              The "/" was in fact the culprit!  Thanks much for the assistance.