Click here to Skip to main content
15,884,537 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
SQL
SelectCommand="SELECT ATHR,HYPERLINK,HEADINGS,NDATE(SYSDATE,'DD-MON-YYYY') FROM NEWS1 order by ndate desc "
Posted
Updated 5-Sep-11 21:20pm
v2
Comments
Mehdi Gholam 6-Sep-11 3:22am    
What is the error?
Pravin Patil, Mumbai 6-Sep-11 3:25am    
Pleae provide the details, like what are you doing, what error you are getting etc.... to get the answer.
Your question is very incomplete.
Prerak Patel 6-Sep-11 3:27am    
NDATE(SYSDATE,'DD-MON-YYYY') seems fishy. What is it by the way?
asok6783 6-Sep-11 3:39am    
my query is "select * from news" .In that oracle table "news" one field is NDATE of date variable.while using select * it is showing the date along with time but i want the date alone

Use Cast or Convert
http://msdn.microsoft.com/en-us/library/ms187928.aspx[^]
SQL
SelectCommand="SELECT ATHR,HYPERLINK,HEADINGS,Convert(varchar, NDATE, 106) FROM NEWS1 order by ndate desc "
 
Share this answer
 
Without the specific error message, we have to guess - but NDATE is not a built in SQL function, so I assume you mean something else...
 
Share this answer
 
Comments
asok6783 6-Sep-11 3:29am    
ndate is a date variable in oracle table
Simon Bang Terkildsen 6-Sep-11 3:31am    
in that case see my answer and replace sysdate with NDATE and remove ndate from the end
asok6783 6-Sep-11 3:45am    
System.Web.HttpException: A field or property with the name 'NDATE' was not found on the selected data source.
I don't know where you gotten the idea of NDATE being a function in PL/SQL.
use to_char e.g.
to_char(sysdate, 'DD-MON-YYYY') ndate
 
Share this answer
 
v2
Comments
asok6783 6-Sep-11 3:46am    
i want to change the ndate(date variable) to char.
if i use to_char(NDATE,'DD-MON-YYYY') it shows the error as
System.Web.HttpException: A field or property with the name 'NDATE' was not found on the selected data source.
Simon Bang Terkildsen 6-Sep-11 6:27am    
Then ndate is not a column in your table.

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