DatePart- function "Quarter"

imfarhan

Board Regular
Joined
Jan 29, 2010
Messages
106
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 ?

Thanks in advance

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

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
58,249
Office Version
  1. 365
Platform
  1. Windows
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
Joined
Jan 29, 2010
Messages
106
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

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
58,249
Office Version
  1. 365
Platform
  1. Windows
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)
 

Forum statistics

Threads
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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Top