Click here to Skip to main content
15,917,991 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear sir
i want to select record current date to later events.



CSS
EventDate	EventDateTo	EventDetails
19 Jan 2012	21 Jan 2012	Test2
12 Jan 2012	14 Jan 2012	Test1
23 Feb 2012	24 Feb 2012	test2
23 Feb 2012	24 Feb 2012	test


thanks in advance
Posted
Comments
manognya kota 19-Jan-12 0:23am    
Could you explain little briefly?

if you want to get all records of current or future date, then you can write sql query as follows:

SQL
select eventDate, eventDetails from table_name where eventDate >= getDate()
 
Share this answer
 
v2
Comments
DINESH K MAURYA 19-Jan-12 0:57am    
thanks
i use it but it not get current date.
for your kind information i use Event date varchar.
You'll have to convert the data to a date:

SQL
select eventDate, eventDetails from table_name where convert(datetime, eventDate) >= getdate()


Please not that on a large table this query will be quite slow. It would be much better to store the date as a date, not as varchar. That way you could also be sure that you only get valid date values.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900