0

Date function

[Previous experience with MS Access & FileMaker; semi-new Ninox user.
Using local  Ninox app, on a MacBook Pro running MacOS Monterey v12.3.]

[I'd add the version of Ninox I'm using, but no clue where to find the version number for the local Ninox app. Suggestions?]

My case: I need a date value that is *only* the day and month, for example, "12 March". I found a thread from 6 years ago that mentioned the snippet below, which looks like it goes in a formula field:

date(Year, Month, Day)
year(Date)
month(Date)
day(Date)

I didn't see any way to construct a value that was just month & day; all of the examples I found included a year. So I figured I could enter any date that had the right month & day, and then I could keep the month & day and discard the year. Although that seems like kind of a clumsy way to go about it. 

However, when I created my formula field and copied the above code into it, I got a message "End expected: year at column 2, line 4". 

I thought maybe it was because I didn't have fields defined for "year", "month" & "day", so I created those fields (as number fields), to use as a place to put the deconstructed values from a date field. That didn't solve the problem. 

I'm sure this is something simple that I'm not seeing. Any insights would be appreciated. 

Oh, and I'll want to convert the month number to the month name, i.e., "5" -> "May". A function field and some kind of lookup table, maybe? 

Thanks again,
Marcia Morrison
in Salem, Massachusetts

3 replies

null
    • zenmom
    • 1 yr ago
    • Reported - view

    [The Ninox online manual starts with this: "...learn how to build powerful Ninox applications without code." I don't think that's strictly true; I keep running into situations where I need maybe not a *lot* of code, but a little code *and* knowing where to put it. Luckily there seems to be a strong user community to help newbies like myself.]

    • Fred
    • 1 yr ago
    • Reported - view

    Yes, this whole "no code" advertising is very mis-leading.

    You can use the format function:

    format(datefield,"D MMM")
    

    Here is a list of formats available.

      • zenmom
      • 1 yr ago
      • Reported - view

      Fred   Ah! Thank you! This is very helpful. 

      M. 

Content aside

  • 1 yr agoLast active
  • 3Replies
  • 102Views
  • 2 Following