How to get the "Year" our of a "date"

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

Access 2003

Unbound box with this control Source:

=Forms![Dashboard-SafetyManagement]!txtEndDate

I want to show just the year

Tried several variations of this:
=Forms![Dashboard-SafetyManagement]!Year([txtEndDate])

Any help here will be appreciated.

Thanks in advance
dave
 
Use the Year function with the entire expression:
=Year(Forms![Dashboard-SafetyManagement]![txtEndDate])
 
Tried that before I posted also and it did not work.

However
formatting the field to: YYYY did work

Thanks much

dave

BruceM said:
Use the Year function with the entire expression:
=Year(Forms![Dashboard-SafetyManagement]![txtEndDate])

Dave said:
Access 2003

Unbound box with this control Source:

=Forms![Dashboard-SafetyManagement]!txtEndDate

I want to show just the year

Tried several variations of this:
=Forms![Dashboard-SafetyManagement]!Year([txtEndDate])

Any help here will be appreciated.

Thanks in advance dave
 
It worked in my test, but perhaps in your project there was already a fomat
in the text box or something like that. Formatting is a perfectly valid
approach, too. Probably better, in fact.

Dave said:
Tried that before I posted also and it did not work.

However
formatting the field to: YYYY did work

Thanks much

dave

BruceM said:
Use the Year function with the entire expression:
=Year(Forms![Dashboard-SafetyManagement]![txtEndDate])

Dave said:
Access 2003

Unbound box with this control Source:

=Forms![Dashboard-SafetyManagement]!txtEndDate

I want to show just the year

Tried several variations of this:
=Forms![Dashboard-SafetyManagement]!Year([txtEndDate])

Any help here will be appreciated.

Thanks in advance dave
 
I very likely could have tried the first example BEFORE I set the formatting
(originally it was mm/dd/yy), which I assume would keep it from working the
way I wanted.

Thanks

dave



BruceM said:
It worked in my test, but perhaps in your project there was already a
fomat in the text box or something like that. Formatting is a perfectly
valid approach, too. Probably better, in fact.

Dave said:
Tried that before I posted also and it did not work.

However
formatting the field to: YYYY did work

Thanks much

dave

BruceM said:
Use the Year function with the entire expression:
=Year(Forms![Dashboard-SafetyManagement]![txtEndDate])

Access 2003

Unbound box with this control Source:

=Forms![Dashboard-SafetyManagement]!txtEndDate

I want to show just the year

Tried several variations of this:
=Forms![Dashboard-SafetyManagement]!Year([txtEndDate])

Any help here will be appreciated.

Thanks in advance dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top