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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Server View Query Builder

Status
Not open for further replies.

ashab02

Programmer
Jun 28, 2005
87
GB
Hello
I am building a query in sql server using the view tool. I was ondering how you convert a date time field that contains the time as well to just the following: dd/mm/yyyy. I've used the cast feature before but unsure where I put this in the query builder window

Any help appreciated.

 
I haven't been able to use CAST for this specific conversion, but this does work:
SET @system_date = CONVERT(varchar(10), GETDATE(), 101)
or, in SQL, you could add something like this to the SELECT statement:
SELECT CONVERT(varchar(10), your_datetime_field, 101) AS
your_new_field_name...
Hope this helps!

I have great faith in fools; self-confidence my friends call it.
-Poe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top