473,387 Members | 1,493 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,387 software developers and data experts.

Quarters of the calendar year

6
I have searched the forum and read some manuals but i cant figure the best way to do this.

All i want to know is what the best way to organize things by quarter. would it be best to use a date and have some code that determines what quarter it should be labeled as? or should i have a table that does this and reference the table through relationships? The format i am looking for is Q107 for example (first quarter and 2007).

jay
access 2003/xp
Jul 16 '07 #1
2 2984
missinglinq
3,532 Expert 2GB
I'm a little fuzzy on exactly what it is you're trying to do, but
Expand|Select|Wrap|Line Numbers
  1. QuarterYear = "Quarter " & DatePart("q",YourDate) & " of " & DatePart("yyyy",YourDate)
will yield, if the date were today

Quarter 3 of 2007

Good Luck and Welcome to TheScripts!

Linq ;0)>
Jul 16 '07 #2
Scott Price
1,384 Expert 1GB
A slight change to Linq's code will yield your Q307 format: This code assigns the value to a label, can be used on either form or report:

Expand|Select|Wrap|Line Numbers
  1. Dim qtr As String
  2. Dim qtrDate As String
  3. Dim qtrYear As String
  4. Dim qtrDateYear As String
  5.  
  6. qtr = DatePart("q", "January 30") ' returns the Quarter for the date specified
  7. qtrDate = "Q" & qtr  ' concatenates Q with #'ed quarter
  8. qtrYear = Right(DatePart("yyyy", "January 30"), 2) ' returns last 2 digits of the current year
  9. qtrDateYear = qtrDate & qtrYear 'concatenates Q# with 2 digit year
  10.  
  11. labelDateQuarter.Caption = "Quarter is: " & qtrDateYear ' assigns value to label caption
  12.  
Not quite as neat as Linq's code, either, but it will assign this message to the caption: "Quarter is: Q107"

Regards,
Scott
Jul 16 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: chennakeshava_ramesh | last post by:
hi, I have a problem, I am not able to find out which day of the week it is using the calendar class. I am using set() function to set the date and want to find out which day i.e mon,tue etc of...
10
by: vinu | last post by:
I have a javascript file named select.js. This is a file which is use to pop up a calendar, when clicked on a calendar icon in an ASP file. have a close button in the calendar. When i click on the...
12
cassbiz
by: cassbiz | last post by:
I downloaded this calendar off the web and am trying have it show twice, once as calendar.php and the second time as calendar1.php I need the visitor to be able to select a beginning date and an...
2
by: Kajsa Anka | last post by:
Before I re-invent something I would like to ask if there exists some code that can be used for create the HTML code for a calendar which I then can include on a web page. The module in the...
6
by: caine | last post by:
I have a clickable calendar, which user can select the day that they want to view the news linking to. My calendar has the clickable event day, but once the user click it, the day selected could...
0
by: mathewgk80 | last post by:
HI all, I am having popup calendar Javascript code. But i dont know how it is connecting to asp.net code.. I am using asp.net,c#.net and also using 3tier architecture with master page.... I...
4
by: gubbachchi | last post by:
Hi all, Please anybody help me solve this problem. I am stuck up with this from past 2 weeks. I am developing an application where, when the user selects date from javascript datepicker and enters...
1
by: abhishekbrave | last post by:
The code below is opening a calendar on mouse over in the same window. I need the calendar to be opened in new window. Have to fulfill this requirement urgentely so posting the whole code here. I...
1
by: swethak | last post by:
Hi, I am desiging the calendar application for that purpose i used the below code. But it is for only displys calendar. And also i want to add the events to calendar. In that code displys the...
1
by: swethak | last post by:
hi, i have a code to disply the calendar and add events to that. It works fine.But my requirement is to i have to disply a weekly and daily calendar.Any body plz suggest that what modifications i...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.