-
sql server query
I Have a date Field say dt1 in table tb1
i need to write a query to retrieve date formatted in dd/mm/yyyy format
the following query
select convert(datetime,dt1,103) from tb1
returns time with date
what query to use
-
Use this:
select convert(varchar(10),dt1,103) ) from tb1
-
thanks it works but 103 style stands for dd/mm/yy not dd/mm/yyyy
-
203
Use 203.
"Add 100 to a style value to get a four-place year that includes the century (yyyy)."
It all in Books Online.
HTH,
Peter
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|