Solved

pulling string values form date field

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

Accepted Solution

by:
Rey Obrero (Capricorn1) 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

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…
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…
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…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

830 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