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
 General SQL Server Forums
 New to SQL Server Programming
 getdate and gettime

Author  Topic 

rnbguy
Constraint Violating Yak Guru

293 Posts

Posted - 2007-01-09 : 20:20:26
im using

print convert(varchar,getdate(),112)

but it prints

YYYYMMDD

which is good but i also need

HHMM

at the end of it so itll be

YYYYMMDDHHMM

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-01-09 : 20:30:40
Just use style 120, then strip out all of the characters that you don't want by using REPLACE.

Or stick with style 112, but then also concatenate style 114 onto it as well as replacing the characters you don't want.

Tara Kizer
Go to Top of Page

rnbguy
Constraint Violating Yak Guru

293 Posts

Posted - 2007-01-09 : 20:42:11
sweet thanx
Go to Top of Page
   

- Advertisement -