using the below t-sql but can only get the date and not the time.
CONVERT(NVARCHAR(16),GETDATE(),112)
Any guidance would very much be appreciated.
thanks in advanceWhat is the exact format you need it in? 112 converts to a CHAR(8)
basically, YYYYMMDD.
For some other possibilities, see http://www.aspfaq.com/2464
"blueboy" <matt_meech@.hotmail.com> wrote in message
news:1140636158.729737.51920@.f14g2000cwb.googlegroups.com...
> Hi im having a few problems saving a file with the data and time i am
> using the below t-sql but can only get the date and not the time.
> CONVERT(NVARCHAR(16),GETDATE(),112)
> Any guidance would very much be appreciated.
> thanks in advance
>|||convert(varchar(50),getdate(),9)
If you look towards the bottom of my blog, I have compiled a list of
diffrent datetime styles.
HTH
MJKulangara
http://sqladventures.blogspot.com|||There are many and you were on the right track for one way.. :)
CONVERT(NVARCHAR(16),GETDATE(),112) +
REPLACE(CONVERT(NVARCHAR(12),GETDATE(),1
14),':','')
Good luck|||hehe you rated your own post :P|||Unintentional...apparently just clicking on it by accident does it.
Don't touch my hubris :-)|||The format i posted outputs
20060222150720407
year
2006
month
02
date
22
hour
15
minute
07
second
20
millisecond
407
then you can append .txt to the end of that|||MJKulangara wrote:
> Unintentional...apparently just clicking on it by accident does it.
> Don't touch my hubris :-)
Gmail is so
Many thanks that has gave me the above format but idealy i would like
just 200602221507
year
2006
month
02
date
22
hour
15
minute
07
Can this be done'|||yes change the nvarchar(12) to a nvarchar(8) to show instead of 12
chars to show the first 8 instead. (cheers!)
No comments:
Post a Comment