Jump to content

DATEPART


rkemunto

Recommended Posts

Does anyone know how I can plug in 01/31/2006 into datepart below:Select RTRIM(CONVERT(Char(01),DATEPART(month,GETDATE())))+"/"+RTRIM(CONVERT(Char(01,)DATEPART(day,GETDATE())))+"/"+RTRIM(CONVERT(Char(2006),DATEPART(year,GETDATE())))

-i am not getting u what exactly u asking and there is some syntax error in ur above stmt...........and i also used ' instead " because i am working in MS SQL SERVER........................Select RTRIM(CONVERT(Char(2),DATEPART(month,GETDATE())))+'/'+RTRIM(CONVERT(Char(2),DATEPART(day,GETDATE())))+'/'+RTRIM(CONVERT(Char(4),DATEPART(year,GETDATE())))
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...