robrodp
asked on
ms sql and asp dates
I have a date field in my ms sql table (fecha). I really cant make any changes in the table.
in my asp code
I set fecha=RecordSet("fecha")
I get fecha a long date with time like;
2017-05-04 12:58:17.0000000
I need to get: (day/month/year)
I am at a loss
in my asp code
I set fecha=RecordSet("fecha")
I get fecha a long date with time like;
2017-05-04 12:58:17.0000000
I need to get: (day/month/year)
I am at a loss
in your select, use
cast(yourDateTimeColumn as Date) yourDateColumn
and use yourDateColumn in your code...
cast(yourDateTimeColumn as Date) yourDateColumn
and use yourDateColumn in your code...
or use this in asp to format
FormatDateTime(yourDateTim eColumn ,"dd/mm/yyyy")
FormatDateTime(yourDateTim
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Did th job
(Potentially stupid question) Doesn't .ASP have the ability to format dates? SQL Server can do this formatting but it will return it as a varchar column and not a date column, which will impact any date math and sorting on the front-end.
Open in new window