Solved

Select Date

Posted on 2008-10-20
7
187 Views
Last Modified: 2012-05-05

Is there a way to have a select statement that shows a description by date.
If the date is today date or pass date description will show up if the date is a future date then the description
does not show up until the present date.
0
Comment
Question by:sevensnake77
[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
  • 4
  • 3
7 Comments
 
LVL 74

Expert Comment

by:sdstuber
ID: 22759778
select your_date, your_description from your_table
where your_date <= sysdate;
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 22759787
the above would be for oracle.

if you're using sql server instead of Oracle put GETDATE() in where there is SYSDATE
0
 
LVL 9

Author Comment

by:sevensnake77
ID: 22760428
Somthing like this

SELECT Id, StartDate, summary Category FROM [News] A
Join Category B	on B.PKCategoryId  = A.Category
where GetDate() = StartDate

Open in new window

0
Turn Insights into Action

Communication across every corner of your business is essential to increase the velocity of your application delivery and support pipeline. Automate, standardize, and contextualize your communication processes with xMatters.

 
LVL 9

Author Comment

by:sevensnake77
ID: 22760507
I tried somethinglike this
WHERE (StartDate >= (2009-09-29) )
But did not seem to work the way I want
0
 
LVL 74

Accepted Solution

by:
sdstuber earned 500 total points
ID: 22760614
GetDate() will give you a date and time so unless StartDate exactly matches the current time down to the second your equality won't work...

but this should...

SELECT Id, StartDate, summary Category FROM [News] A
Join Category B      on B.PKCategoryId  = A.Category
where GetDate() >= StartDate
0
 
LVL 9

Author Closing Comment

by:sevensnake77
ID: 31507892
Thanks
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 22760760
glad I could help
0

Featured Post

Raise the IQ of Your IT Alerts

From IT major incidents to manufacturing line slowdowns, every business process generates insights that need to reach the people required to take action. You need a platform that integrates with your business tools to create fully enabled DevOps toolchains.

You need xMatters.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

691 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