[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 390
  • Last Modified:

DatePart Q

How can i change datePart Q to start my VAT quarter in November rather than January
0
mraddie
Asked:
mraddie
  • 2
  • 2
4 Solutions
 
Rick_RickardsCommented:
Since DatePart() will want the first Qtr to start in January and in fact you want it to start 2 months in advance of that, ie: November you could get DatePart to return the number as If November were the first Qtr if you advanced the date it's evaluating forward by 2 months as follows...

DatePart("Q", DateSerial(Year(Date), Month(Date) + 2, Day(Date)))
0
 
mraddieAuthor Commented:
Thanks Rick, this is almost what i need. The only problem is, that the query is drawing a few dates from the month prior to the months i need in datepart q.
0
 
Rick_RickardsCommented:
Which dates?
0
 
ee_rleeCommented:
hi

the prob is bec months don't have the same # of days. ie. july 31 + 2 months = sept 31. but sept only has 30 days so it will be convered to oct 1 which is already the start of the 4th quarter.

try this is code to fix this:

DatePart("Q", DateSerial(Year(Date), Month(Date) + 2, 1))
0
 
mraddieAuthor Commented:
Thanks all, I've more or less got it sorted
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now