Solved

pulling string values form date field

Posted on 2013-12-17
4
274 Views
Last Modified: 2014-02-05
I have a date field [EndDate], I want to capture year and month and put them in a text field [RefPeriod] with the following text format yy-mmm

Example: for 30-Nov-13 in EndDate, I would like to have 13-Nov in RefPeriod

Thank you
0
Comment
Question by:fitaliano
4 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 250 total points
ID: 39724113
=format(EndDate, "yy-mmm")
0
 
LVL 4

Assisted Solution

by:AccessGuy1763
AccessGuy1763 earned 250 total points
ID: 39724121
It should be:

Format([EndDate],"yy-mmm")

I would probably add it to the underlying record source for your form and then set the control source of [RefPeriod] to whatever you call the column in the record source.

Edit - you could also just add it directly to the control source as capricorn suggests.
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 39724131
personally, I'd advise against storing this value, as it can always be recomputed when you need it via a query.
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 39726078
Just use a textbox on your form bound to EndDate.
Then set the Format property of the textbox to:

  yy\-mmm

/gustav
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now