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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Getting the date in the english format

Author  Topic 

g_r_a_robinson
Starting Member

45 Posts

Posted - 2004-02-02 : 20:23:23
I'm using the function below to get my date into a relevant format:

CREATE FUNCTION dbo.DatePart
( @fDate datetime )
RETURNS varchar(10)
AS
BEGIN
RETURN ( CONVERT(varchar(10),@fDate,101) )
END

I'm not sure if the above is directly responsible or whether I need to look at something else but my dates are being returned in
this format 'month/day/year' and I need them as 'day/month/year'. Anyone know how to acheive this.

My code


SELECT DISTINCT Master_Jobs.JobID, Master_Jobs.Job_Title, Master_Jobs.Contact, dbo.DatePart(Master_Jobs.Due_Date) as Due_Date, Master_Jobs.Due_Time, Master_Jobs.Next_Action, Master_Jobs.By_Who,
Master_Jobs.Completed, Users.UserID AS UserID, Backup_UserNotes.BackUp_Read, Users.Name

ehorn
Master Smack Fu Yak Hacker

1632 Posts

Posted - 2004-02-02 : 21:16:03
[code]CONVERT(varchar(10),@fDate,103)[/code]
Go to Top of Page
   

- Advertisement -