Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
shaneschmidt
Starting Member
17 Posts |
Posted - 2002-10-13 : 19:04:00
|
| How would I convert a varchar field (10) called startdate with values of 31/12/2002 etc to a datetime in format 103 in my select statement |
|
|
AjarnMark
SQL Slashing Gunting Master
3246 Posts |
Posted - 2002-10-13 : 19:09:15
|
| How about...SELECT CONVERT(datetime, StartDate, 103) |
 |
|
|
shaneschmidt
Starting Member
17 Posts |
Posted - 2002-10-14 : 02:29:57
|
quote: How about...SELECT CONVERT(datetime, StartDate, 103)
|
 |
|
|
shaneschmidt
Starting Member
17 Posts |
Posted - 2002-10-14 : 02:35:03
|
quote: Many Thanks But I still return the format 2002-09-01 00:00 etcwhan all I want to do is return the date format 01/09/2002 from the varchar(10) ie 01/09/2002 Is there another format I shoud be using to return the same valueSELECT CONVERT(datetime, StartDate, 103)
|
 |
|
|
AjarnMark
SQL Slashing Gunting Master
3246 Posts |
Posted - 2002-10-14 : 16:43:49
|
| There is no date-only data type in SQL Server. You could do SELECT CONVERT(varchar(10), CONVERT(datetime, StartDate, 103), 103). This seems redundant to me...Edited by - AjarnMark on 10/14/2002 16:46:16 |
 |
|
|
shaneschmidt
Starting Member
17 Posts |
Posted - 2002-10-14 : 19:23:53
|
quote: Thanks Mark Im try to use a drop down menu using startdate convertingto a date in the same format ie 10/12/2002 from a varchar and then select distinct...There is no date-only data type in SQL Server. You could do SELECT CONVERT(varchar(10), CONVERT(datetime, StartDate, 103), 103). This seems redundant to me...Edited by - AjarnMark on 10/14/2002 16:46:16
|
 |
|
|
|
|
|
|
|