You are here: Re: Insert Date as Formatted String « MsSQL Server « IT news, forums, messages
Re: Insert Date as Formatted String

Posted by Utahduck on 02/22/07 15:17

On Feb 22, 7:22 am, paulmac...@gmail.com wrote:
> Hello,
>
> I thought this would be easy, and I've read a lot of posts, but I
> can't seem to find exactly what I'm trying to do.
>
> >From within a stored procedure I would like to insert a date value
>
> into another table to a Char(8) field....but I want the value to be
> formatted as YYYYMMDD (specifically no "/"'s)
>
> Insert into Temp (sFromDate) Values (getdate()) (20070221)
>
> Any ideas?
>
> thanks so much!

FYI, here are all the date conversions I've been able to find (use as
CONVERT(varchar, GetDate(), #) ):

# Format8
0 Oct 7 2003 10:59AM
1 10/07/03
2 03.10.07
3 07/10/03
4 07.10.03
5 07-10-03
6 07 Oct 03
7 Oct 07, 03
8 10:59:00
9 Oct 7 2003 10:59:00:763AM
10 10-07-03
11 03/10/07
12 031007
13 07 Oct 2003 10:59:00:763
14 10:59:00:763
20 2003-10-07 10:59:00
21 2003-10-07 10:59:00.763
22 10/07/03 10:59:00 AM
23 2003-10-07
24 10:59:00
25 2003-10-07 10:59:00.763
100 Oct 7 2003 10:59AM
101 10/07/2003
102 2003.10.07
103 07/10/2003
104 07.10.2003
105 07-10-2003
106 07 Oct 2003
107 Oct 07, 2003
108 10:59:00
109 Oct 7 2003 10:59:00:763AM
110 10-07-2003
111 2003/10/07
112 20031007
113 07 Oct 2003 10:59:00:763
114 10:59:00:763
120 2003-10-07 10:59:00
121 2003-10-07 10:59:00.763
130 11 ????? 1424 10:59:00:763AM
131 11/08/1424 10:59:00:763AM

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация