Do not use on any
shared computer
September 5, 2008 10:42pm pdt
 
[x]
Attachment Details

Comparing date

Tags: comparing, date
I have:

select  ClientNo, ClientFName, ClientLName, PsychSocialCognitiveDate, ????
from PsychSocialCognitive, Demo
where ClientNo = ClientNumberPsychSocialCognitive
      and PsychSocialCognitiveDate > '01/01/1900'
order by ClientLName, ClientFName

What I want to compare is if
1) PsychSocialCognitiveDate is within 6 months from now (=today) or
2) PsychSocialCognitiveDate is within 12 months (= 1 year) from now (=today)  or
3) PsychSocialCognitiveDate is over 1 year from now (=today)

The output, along with ClientNo, ClientFName, ClientLName, should say:

1) if PsychSocialCognitiveDate is within 6 months from now
    'Yes' with the number of days passed under 'Within 6 months' column
2) if PsychSocialCognitiveDate is within 12 months (= 1 year) from now
    'Yes' with the number of days passed under Within 12 months' column
3) if PsychSocialCognitiveDate is over 1 year from now
    'Yes' with the number of days passed under 'Over 1 Year' column

i.e.

ClientNo  ClientFName ClientLName  PsychSocialCognitiveDate  < 6 months < 12 months  >1 year
741            John                  Doe                      2005-12-12                                                        yes(398)
723            Ethel                Dorko                     2005-08-19                                                        yes (423)
bla....

( ) -> the number of days elapsed from now (today).

thx
Start your free trial to view this solution
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Question Stats
Zone: Microsoft
Question Asked By: ethanjohnsons
Solution Provided By: imitchie
Participating Experts: 4
Solution Grade: A
Views: 0
Translate:
Loading Advertisement...
 
[+][-]Expert Comment by imitchie

Rank: Wizard

Expert Comment by imitchie:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by imitchie

Rank: Wizard

Expert Comment by imitchie:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by aneeshattingal

Rank: Genius

Expert Comment by aneeshattingal:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Assisted Solution by aneeshattingal

Rank: Genius

Assisted Solution by aneeshattingal:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Assisted Solution by dtodd

Rank: Sage

Assisted Solution by dtodd:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by imitchie

Rank: Wizard

Expert Comment by imitchie:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Accepted Solution by imitchie

Rank: Wizard

Accepted Solution by imitchie:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by auke_t

Rank: Master

Expert Comment by auke_t:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by ethanjohnsons
Author Comment by ethanjohnsons:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by dtodd

Rank: Sage

Expert Comment by dtodd:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by imitchie

Rank: Wizard

Expert Comment by imitchie:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080723-EE-VQP-34 / EE_QW_2_20070628