?
Solved

Access get quarter from date

Posted on 2013-11-20
2
Medium Priority
?
555 Views
Last Modified: 2013-11-20
Dear Experts,

I want to be able to produce a calculated field in a table which will show the quarter in which an invoice is raised.  The date the invoice is raised comes from [Invoice Date].

I can see how to split it into months, years etc. but not by quarter

Can anybody help?
0
Comment
Question by:correlate
2 Comments
 
LVL 40

Accepted Solution

by:
PatHartman earned 2000 total points
ID: 39663173
There is no need to store the value.  Add a calculated field to your query using the Format() function.

Select ..., Format(YourDate, "yyyy-q") as InvQtr
From YourTable;

Look up the Format function to see all the options.  The expression above will return 2013-4 for today's date.
0
 

Author Closing Comment

by:correlate
ID: 39663210
perfect -thank you very much, works a treat
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
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.
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…

850 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