473,378 Members | 1,544 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

get Quarter value for specific date

All,

I try to get specific date's quarter value, for eaxmple quarter value is 1
for 02/04/2008, anyone can help this out?

Thanks

Martin
Feb 4 '08 #1
6 16906
how about something like
Select Case MyDate.Month
Case 1 to 3
Qtr = 1
Case 4 to 6
Qtr = 2
etc
--
Terry
"martin1" wrote:
All,

I try to get specific date's quarter value, for eaxmple quarter value is 1
for 02/04/2008, anyone can help this out?

Thanks

Martin
Feb 4 '08 #2
Here is another one...
Qtr = ((MyDate.Month - 1) \ 3) + 1
--
Terry
"martin1" wrote:
All,

I try to get specific date's quarter value, for eaxmple quarter value is 1
for 02/04/2008, anyone can help this out?

Thanks

Martin
Feb 4 '08 #3
"martin1" <ma*****@discussions.microsoft.comschrieb
All,

I try to get specific date's quarter value, for eaxmple quarter
value is 1 for 02/04/2008, anyone can help this out?
Dim d As Date = #2/4/2008#
Dim q As Integer

q = (d.Month \ 4) + 1
Armin
Feb 5 '08 #4
"Armin Zingler" <az*******@freenet.deschrieb
Dim d As Date = #2/4/2008#
Dim q As Integer

q = (d.Month \ 4) + 1
*argh* forget it. Wrong. Right answer given meanwhile.
Armin
Feb 5 '08 #5
Thank you all. That is helpful

Martin

"Terry" wrote:
how about something like
Select Case MyDate.Month
Case 1 to 3
Qtr = 1
Case 4 to 6
Qtr = 2
etc
--
Terry
"martin1" wrote:
All,

I try to get specific date's quarter value, for eaxmple quarter value is 1
for 02/04/2008, anyone can help this out?

Thanks

Martin
Feb 5 '08 #6
Dim dtmCurrentDateTime As System.DateTime = Now()
Dim iCurrentQuarter As System.Int32 = DatePart(DateInterval.Quarter, dtmCurrentDateTime)
Jul 18 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Matt | last post by:
Hello, I have a query that I would like to schedule in DTS. The criteria of this query checks for records in the table that are within the current quarter. Here is what I have. WHERE...
1
by: Terencetrent | last post by:
I have created a query that examines qarterly sales for 5 regions in the country. The query contains data for the past 6 quarters for each region and calculates the perecentage of total sales for...
14
by: tlyczko | last post by:
I am looking to validate time worked in quarter-hour increments, e.g. ..25, .5, .75, 1.0, etc. etc. I know I can use a modulo statement for the evaluation but I could not find an explanation of...
8
by: Dominique Vandensteen | last post by:
I have a datetime and want to format it to "quarter year" so 20 december 2003 should give: "4-2003" is this possible? I don't find a format character for quarter :-( Dominique
2
by: JohnC | last post by:
This fantastic expression was posted by Duane Hookom. I have no idea how it works but it displays the fiscal year and quarter for FY starting on October 1. =Format$(DateAdd("q",1,),"\Qq...
1
by: mnoland | last post by:
I relay need some help I am looking to find every quarter between 2 dates here is an example of what i am trying to do data table client sbegin send 499 1-1-2000 6-1-2001...
2
by: p.smachylo | last post by:
Hello, I am relatively new to Microsoft Access and databases in general, and have a problem - one which I think may necessitate some VBA code (or maybe just modification of the criteria section of...
2
benchpolo
by: benchpolo | last post by:
First Day of the QUARTER select DATEADD(qq, DATEDIFF(qq,0,getdate()), 0) Question: How do I get the last DAY of the QUARTER? For example: 1st Quarter is 01/01/2008 to 03/31/2008. I am...
4
by: gimme_this_gimme_that | last post by:
Is there a way to get the last day of the previous business quarter from DB2? For 10/21/2008 the day would be 9/30/2008. Thanks.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.