[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

date diff query

Posted on 2004-08-12
7
Medium Priority
?
220 Views
Last Modified: 2012-05-05
lets say i have a database with player names and a date where the player will suspended until.

how can i query my database so when the date is past due then the player will not show in my query anymore.  

so if   Giancarlo Barraza will be suspended from   january 1, 2004   to  august 12, 2004    then in august 13, 2004 i do not want to include him in the results.
0
Comment
Question by:gianitoo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 17

Accepted Solution

by:
BillAn1 earned 2000 total points
ID: 11788852
select * from playertable
where suspendeddate > getdate()
0
 
LVL 7

Expert Comment

by:FDzjuba
ID: 11788951
SELECT PlayerName FROM PlayerTable WHERE SuspendData>getdate()
0
 
LVL 15

Expert Comment

by:jdlambert1
ID: 11790009
I think you need three date filters:

SELECT *
FROM PlayerTable
WHERE SuspensionStartDate IS NULL  --this keeps players without a suspension
 OR SuspensionStartDate > GetDate() --this keeps players whose suspensions haven't started yet
 OR SuspensionEndDate  < GetDate() --this keeps players whose suspensions have ended
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 1

Expert Comment

by:amulya_333
ID: 11791397
I go with BillAn1 's answer. That's the solution.
0
 
LVL 7

Expert Comment

by:FDzjuba
ID: 11791769
maybe i don't get something, why is this question is 500 points?
0
 
LVL 17

Expert Comment

by:BillAn1
ID: 11791779
The points reflect how important the answer is to the person asking the question, not necessarily how 'difficult' the question is. That's the cut and thrust of the market economy I guess :-)
0
 
LVL 1

Author Comment

by:gianitoo
ID: 11792032
500 points because it was very critical for me to get this answer right away.    Importance was extremely high and because of great people like you i was able to meet my web project deadline.....


peace and love
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question