Dates in Text fields

G

Guest

Hi all,
I am date stamping records in access with month and year eg JAN05 to denote
which reporting period a record belongs to. I have an unbound text box the
user enters this value in to update to all chosen records, the default value
of this is
=Format(Date(),"mmmyy")
The user has now requested it defaults to the month before the current
month. Since this is not a real date field I can not put -1 in the
calculation to achieve the month previous, can anyone tell me a way round
this please?

Thanks in advance for any help.
Sue
 
G

Guest

One more thing sorry... in a report how would I sort this text in month order
as opposed to alphabetically with it being a text field (storing JAN05 etc)?

Thanks in advance for any help.
Sue
 
R

Rick Brandt

hughess7 said:
One more thing sorry... in a report how would I sort this text in
month order as opposed to alphabetically with it being a text field
(storing JAN05 etc)?

You want a formatted date then you get a string sort. Leave it as an actual
date and you get a date sort. You'll need to include both so you can
display one and sort on the other.
 
G

Guest

Not sure what you meant by that... but I found a similar posting earlier that
you answered. I have created a new field in the query ReportingDate:
=Format(CDate(Left([C/B Report_Date],3) & "-01-20" & Right([C/B
Report_Date],2)),"yyyy-mm")

This sorted it thanks :)

Sue
 

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

Top