Solved

pulling string values form date field

Posted on 2013-12-17
4
273 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

707 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

14 Experts available now in Live!

Get 1:1 Help Now