Displaying the Date Quarter in a Query (1 Viewer)

etiangsonizer

New member
Local time
Today, 12:31
Joined
Feb 3, 2007
Messages
2
Is there a simple formula to return the fiscal year quarter that applies to a date? I simply want January thru March to show as Qtr 1, etc.

thanks
 

PeterF

Registered User.
Local time
Today, 21:31
Joined
Jun 6, 2006
Messages
295
Something like this?
"Qtr " & (((month(#12/05/2007#)-1)\3)+1)
 

etiangsonizer

New member
Local time
Today, 12:31
Joined
Feb 3, 2007
Messages
2
thanks for the quick reply. i already did what you said. thanks a lot.
 

boblarson

Smeghead
Local time
Today, 12:31
Joined
Jan 12, 2001
Messages
32,059
This will also work:
Code:
Format(YourDateFieldHere,"q")
 

raskew

AWF VIP
Local time
Today, 14:31
Joined
Jun 2, 2001
Messages
2,734
Hi -

There are many instances when a fiscal year does not start on 1 Jan. Try the following which allows the user to specify the FY start date.
Code:
Function fGetFYQtr(FYStart As Date, pDate As Date) As Integer
'To call: from debug (immediate window)
'? fGetFYQtr(#7/1/06#, date())
'returns: 3
   fGetFYQtr = DateDiff("m", FYStart, pDate) \ 3 + 1
End Function

HTH - Bob
 

kzutter

New member
Local time
Today, 12:31
Joined
Feb 6, 2013
Messages
2
[FONT=&quot]Public Function Quarter(TheDate As Date) As Variant
'Enter with a date
'Returns the Quarter that date is in
'where July 1 is start of fiscal year
'Change the Choice items for different fiscal year start quarters


Quarter = Choose(DatePart("q", TheDate), 3, 4, 1, 2)

End Function
[/FONT]
 

Masikonde

New member
Local time
Today, 15:31
Joined
Jul 21, 2020
Messages
8
Something like this?
"Qtr " & (((month(#12/05/2007#)-1)\3)+1)
Is it possible to apply the same formula to multiple years and Quarters, where there are different years and Quarters? I'm facing a similar problem but I have a column for different years and a column for different quarters, and I need to combine the two to come up with a date.
 
Last edited:

plog

Banishment Pending
Local time
Today, 14:31
Joined
May 11, 2011
Messages
11,635
Having a hard time visualizing what you want. Can you demonstrate your issue with data? The best way is with 2 sets of data:

A. Starting data from your table(s). Include table and field names and enough data to cover all cases.

B. Expected results of A. Show what data you expect to end up with when you feed in the data from A.
 

Masikonde

New member
Local time
Today, 15:31
Joined
Jul 21, 2020
Messages
8
I'm looking to populate the last column "Actual Planned Date" with the "mm/dd/yyyy" as shown in the attachment
 

Attachments

  • works data2.pdf
    53.3 KB · Views: 239

plog

Banishment Pending
Local time
Today, 14:31
Joined
May 11, 2011
Messages
11,635
You can do that in a query using the CDate() function:

 

Isaac

Lifelong Learner
Local time
Today, 12:31
Joined
Mar 14, 2017
Messages
8,774
Or if all you want is a text display, you could even concatenate them:

Code:
ActualPlannedDate: [Planned_Month_Sales] & "/" & [Planned_Date_Sales] & "/" & [Planned_Year_Sales]
 

Users who are viewing this thread

Top Bottom