Re: FN-FORUM: sql question
date posted 7th August 2004 12:25
PAMELA WHITTAKER wrote:
> I have a date stored as dd/mm/yy as a vchar in an sql database. How do I
> write an sql statement to select a date range? Is there some way of
> converting it to a date format in the select statement?
If it is MSSQL, you could try
http://msdn.microsoft.com/library/en-us/tsqlref/ts_ca-co_2f3o.asp
or use SUBSTRING
substring(datefield,7,2) + substring(datefield,4,2) +
substring(datefield,1,2)
Either way is going to be innefficient compared to just converting them
to date data type, the second way will land you in prison.
--
http://www.dandylogic.com