Solved

Access get quarter from date

Posted on 2013-11-20
2
532 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 35

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
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…
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, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

808 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