Solved

Select Date

Posted on 2008-10-20
7
158 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
  • 4
  • 3
7 Comments
 
LVL 73

Expert Comment

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

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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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 73

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 73

Expert Comment

by:sdstuber
ID: 22760760
glad I could help
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now