Solved

Access get quarter from date

Posted on 2013-11-20
2
537 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 36

Accepted Solution

by:
PatHartman earned 500 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

733 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