DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   MS SQL (http://www.daniweb.com/forums/forum127.html)
-   -   Simple Question PLease URGENT (http://www.daniweb.com/forums/thread122760.html)

firas489 May 6th, 2008 10:02 am
Simple Question PLease URGENT
 
Hello All,

I'm having a little problem in witting an SQL statement.
I'm sure there is a simple solution for it but its just not clicking with me!.

Anywayz,

I'm trying to write a statement that in the FROM clause, there is a formula, and i would like to assign conditions to this formula in the WHERE Clause
Ex:

SELECT DateValue(FLD_AS_STRING) FROM Table1 WHERE ???

I want the statement to convert the FLD_AS_STRING field (which is in string format) to Date format, and in the same time i want to only view fields that it's FLD_AS_STRING is greater than today's date (after it is converted to Date)?

How can i do that in this statement?


Thanks in advance,


Best Regards
Firas S Assaad

Sulley's Boo May 6th, 2008 10:13 am
Re: Simple Question PLease URGENT
 
select to_date(FLD_AS_STRING, 'dd/mm/yyyy') 
from Table1
where to_date(FLD_AS_STRING, 'dd/mm/yyyy') > sysdate;


All times are GMT -4. The time now is 1:27 am.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC