Create view select date = year 2012

Hello all,

Returning to notes after 6 years. Most of my knowledge has evaporated. :frowning:

Stumbling around the new interface (it was V5 back then) and I am struggling on getting a view to select all documents where a (date) field in the document is in 2012. I thought it was going to be easy.

I’ve tried many things and now resorting to help.

Currently the selection formula is:

SELECT (Form = “Travel Request ST” & @Right(@Text(DepartDate;“d0”);4) =“2012”)

When I add a column with just:

@Right(@Text(DepartDate;“d0”);4)

I get only the year – but I can’t get it to match 2012.

Please help!

Regards,

Glenn.

Subject: Try this

Assuming DepartDate is a date field:

SELECT Form = “Travel Request ST” & @Year(DepartDate)=2012

Subject: Solved!

I had tried that also but didn’t get any hits.

But you did give me the confidence to assume it should work and look for problems elsewhere.

I’ve inherited the database and discovered that the form that I used in the formula looks exactly like the one displayed when using the application - it actually isn’t the one used. Once I worked that out things went smoothly! Was only 4 or 5 hours wasted. :frowning:

Thanks for your help!

Subject: Don’t you hate when that happens… :slight_smile:

What I always do when I inherit a database someone else developed and I need to make a cahnge or add a view, is to look at the properties of the document to see what form was used. Sometimes the form has an alias, and then the alias is stored in the Form field…

Even when it is my own database, I use the document properties to try to figure out why the views don’t display what I expect. I write down the formula, then look at the document and verify every field (value and data type) used in the formula.

I found that this is the best way to find out what I did wrong in the view formula.