DatePart Q

How can i change datePart Q to start my VAT quarter in November rather than January
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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)))
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.
Which dates?

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))
mraddieAuthor Commented:
Thanks all, I've more or less got it sorted

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.