Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select to display date in correct format

Status
Not open for further replies.

TRACEYMARYLAND

Programmer
May 21, 2004
370
0
0
US
i have field type of DATETIME
and need to return this in select
as '1/1/2004'

I tried this
select CONVERT(NVARCHAR(15),FIELD_DATE,112) as 'FIELD_DATE' , * from form_values

but when i do thist in ASP nothing is being printed out

if rs("FIELD_DATE") = trim(request("txtSearch")) then
response.write "found"
end if
 
Really you are trying to convert the Date into strings to check!

Not a good idea try converting as Lothario suggest but convert to a date

And Convert your VBScript date too

Convert(Datetime, CONVERT(NVARCHAR(15),FIELD_DATE,101), 101)

and the VBScript

Cdate(Datetext)


==========================
Date is a way to show you care
Time is a great healer
DateTime is just damn confusing

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top