# DatePart- function "Quarter"

#### imfarhan

##### Board Regular
Hi
If I'm right we are in Quarter =1 ,so why my following query brings the result quarter=2 ?

Select
DatePart("q",Now()) AS Financial_Quarter,
"01/04/" & IIf(DatePart("q",Now())=1,Year(Now())-1,Year(Now())) As Fi
FROM Table_Name

Ans= 2 ?

Many thanks
Farhan

### Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

#### Joe4

If I'm right we are in Quarter =1 ,so why my following query brings the result quarter=2 ?
No, we are actually in the second quarter now. The first quarter ended March 31 and the second quarter started April 1. Today is April 8, putting us in the second quarter.

#### imfarhan

##### Board Regular
I think bit confusion, the starting quarter of the Financial/fiscal year is
Apr to Jun = 1st Quarter
Jul to Sep = 2nd Quarter
Oct to Dec = 3rd Quarter
Jan to March = 4th Quarter

As per above rule the current quarter should be " 1 " using today's date i.e. 08/Apr/2010

Sorry , bit mixing the financial jargon wording

Many thanks
Farhan

#### Joe4

Ah, you didn't mention that you were dealing with a non-standard quarter calendar.

Something like this calculation should work:
Code:
``IIf(DatePart("q",Now())=4,1,DatePart("q",Now())+1)``

#### imfarhan

##### Board Regular
Many thanks Joe

You sorted my problem
Kind regards
Farhan

Replies
9
Views
574
Replies
2
Views
462
Replies
7
Views
258
Replies
6
Views
751
Replies
3
Views
247

1,136,354
Messages
5,675,301
Members
419,560
Latest member
g3org

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back