Results 1 to 8 of 8

Thread: [Resolved]how to get current the next 2 quartes?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    150

    [Resolved]how to get current the next 2 quartes?

    hi all,
    my sql database has dates in this format:
    Q106 Q206 Q306 Q406 Q107 Q207 Q307 Q407

    how can extract data based on the Current and the Next Two Quarters dynamically (Q406, Q107, Q207) ?

    any tips are appreciated.
    waely
    Last edited by waely; Dec 4th, 2006 at 02:16 PM.

  2. #2
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: how to get current the next 2 quartes?

    how are you storing the date values, I mean in which data type. and how do u say current quarter is Q406, is there any logic you have for the continuous quarter numbers...
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    150

    Re: how to get current the next 2 quartes?

    the dates are stored in date format. I meant the fields names are called Q106,Q206 etc... but the data type is date.

    thanks

  4. #4
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: how to get current the next 2 quartes?

    You mean, you are storing the dates in different fields itself...strange..but anyhow...to get for 1 quarter then use something like this in your sql statement...
    VB Code:
    1. ....Where Q106 IS NOT Null
    2. 'or
    3. ....Where IsNull (Q106) = False
    Im assuming for the other quarters this column will be null otherwise you can use Q106 <> ""
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    150

    Re: how to get current the next 2 quartes?

    dear ganeshmoorthy. I think we have misunderstanding so let me explain in more details. my table has about 25 fields. Project _D is one of them and also date fields which start from (2004) Q104 -----> (2017)Q417
    these fields are in Date format and all have data in them. my problem is to dynamically check for current system date, figure out which quarter we're in then display it along with the next three quarters. for example if I run my report today I should get Q406 and also the next three quartes Q107,Q207,Q307.

    hope this is clear.
    thanks for your help

  6. #6
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: [Resolved]how to get current the next 2 quartes?

    Waely, Could you post some sample values stored in the Datefields...and the name of the fields
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    150

    Re: [Resolved]how to get current the next 2 quartes?

    sorry to waste your time but specification for the report has changed and I don't need to do my report this way.

    thank you for your attempts to help me.

  8. #8
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: [Resolved]how to get current the next 2 quartes?

    no probs....
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width