I have a table with a field of type datetime.
tblFoo
-------------------------
FooDate [smalldatetime]
Sample data
tblFoo
-------------------------
FooDate
2007-05-02 00:00:00
select datepart(dd,FooDate) from tblFoo = 2
select convert(datetime,FooDate,103) from tblFoo = 2007-05-02 00:00:00.000
Yet...
Set oRs = Server.CreateObject("ADODB.Recordset")
oRs.ActiveConnection = MM_conn_asp_STRING
oRs.Source = "SELECT convert(datetime,FooDate,103) FROM tblFoo ORDER BY FooDate DESC"
oRs.CursorType = 0
oRs.CursorLocation = 2
oRs.LockType = 1
oRs.Open()
While (NOT oRs.EOF)
response.Write (oRs.Fields.Item("FooDate").Value & "<br/>")
oRs.MoveNext()
Wend
response.end
Gives me 5/2/2007
Any ideas 103 format is dd/mm/yy
tblFoo
-------------------------
FooDate [smalldatetime]
Sample data
tblFoo
-------------------------
FooDate
2007-05-02 00:00:00
select datepart(dd,FooDate) from tblFoo = 2
select convert(datetime,FooDate,103) from tblFoo = 2007-05-02 00:00:00.000
Yet...
Set oRs = Server.CreateObject("ADODB.Recordset")
oRs.ActiveConnection = MM_conn_asp_STRING
oRs.Source = "SELECT convert(datetime,FooDate,103) FROM tblFoo ORDER BY FooDate DESC"
oRs.CursorType = 0
oRs.CursorLocation = 2
oRs.LockType = 1
oRs.Open()
While (NOT oRs.EOF)
response.Write (oRs.Fields.Item("FooDate").Value & "<br/>")
oRs.MoveNext()
Wend
response.end
Gives me 5/2/2007
Any ideas 103 format is dd/mm/yy