Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2008

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave - 15 May 2008 16:37 GMT
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
BruceM - 15 May 2008 16:45 GMT
Use the Year function with the entire expression:
=Year(Forms![Dashboard-SafetyManagement]![txtEndDate])

> Access 2003
>
[quoted text clipped - 10 lines]
>
> Thanks in advance  dave
Dave - 15 May 2008 16:49 GMT
Tried that before I posted also and it did not work.

However
formatting the field to: YYYY did work

Thanks much

dave

> Use the Year function with the entire expression:
> =Year(Forms![Dashboard-SafetyManagement]![txtEndDate])
[quoted text clipped - 13 lines]
>>
>> Thanks in advance  dave
BruceM - 15 May 2008 17:02 GMT
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.

> Tried that before I posted also and it did not work.
>
[quoted text clipped - 22 lines]
>>>
>>> Thanks in advance  dave
Dave - 15 May 2008 17:09 GMT
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

> 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
[quoted text clipped - 26 lines]
>>>>
>>>> Thanks in advance  dave
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.