Showing posts with label files. Show all posts
Showing posts with label files. Show all posts

Sunday, March 11, 2012

Date Formats

We have recently upgraded from SQL 6.5 to SQL 2000, and are having problems
with the date format in BCP'd files.
Previously 6.5 would output dates such as 1 Jan 2004 and 20 Jan 2004, but
SQL 2000, leaves a leading zero on 01 jan 2004.
I have used the convert function to make to date to 01 jan 2004, but how do
I suppress the leading zero on the date ?
Any help would be appreciarted
MarkYou could make your own function, along these lines:
http://www.aspfaq.com/2460
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Flems" <Mark.Flemans@.apakgroup.com> wrote in message
news:O5JaVwdAEHA.2480@.TK2MSFTNGP12.phx.gbl...
> We have recently upgraded from SQL 6.5 to SQL 2000, and are having
problems
> with the date format in BCP'd files.
> Previously 6.5 would output dates such as 1 Jan 2004 and 20 Jan 2004, but
> SQL 2000, leaves a leading zero on 01 jan 2004.
> I have used the convert function to make to date to 01 jan 2004, but how
do
> I suppress the leading zero on the date ?
> Any help would be appreciarted
> Mark
>|||Thanks for that, I'd just discovered that you can create a function. It all
now works fine !!
Cheers
Mark
"Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
news:OarRSRgAEHA.808@.TK2MSFTNGP12.phx.gbl...
> You could make your own function, along these lines:
> http://www.aspfaq.com/2460
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
>
> "Flems" <Mark.Flemans@.apakgroup.com> wrote in message
> news:O5JaVwdAEHA.2480@.TK2MSFTNGP12.phx.gbl...
> > We have recently upgraded from SQL 6.5 to SQL 2000, and are having
> problems
> > with the date format in BCP'd files.
> >
> > Previously 6.5 would output dates such as 1 Jan 2004 and 20 Jan 2004,
but
> > SQL 2000, leaves a leading zero on 01 jan 2004.
> >
> > I have used the convert function to make to date to 01 jan 2004, but how
> do
> > I suppress the leading zero on the date ?
> >
> > Any help would be appreciarted
> >
> > Mark
> >
> >
>

Thursday, March 8, 2012

Date Formats

We have recently upgraded from SQL 6.5 to SQL 2000, and are having problems
with the date format in BCP'd files.
Previously 6.5 would output dates such as 1 Jan 2004 and 20 Jan 2004, but
SQL 2000, leaves a leading zero on 01 jan 2004.
I have used the convert function to make to date to 01 jan 2004, but how do
I suppress the leading zero on the date ?
Any help would be appreciarted
MarkYou could make your own function, along these lines:
http://www.aspfaq.com/2460
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Flems" <Mark.Flemans@.apakgroup.com> wrote in message
news:O5JaVwdAEHA.2480@.TK2MSFTNGP12.phx.gbl...
> We have recently upgraded from SQL 6.5 to SQL 2000, and are having
problems
> with the date format in BCP'd files.
> Previously 6.5 would output dates such as 1 Jan 2004 and 20 Jan 2004, but
> SQL 2000, leaves a leading zero on 01 jan 2004.
> I have used the convert function to make to date to 01 jan 2004, but how
do
> I suppress the leading zero on the date ?
> Any help would be appreciarted
> Mark
>|||Thanks for that, I'd just discovered that you can create a function. It all
now works fine !!
Cheers
Mark
"Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
news:OarRSRgAEHA.808@.TK2MSFTNGP12.phx.gbl...
> You could make your own function, along these lines:
> http://www.aspfaq.com/2460
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
>
> "Flems" <Mark.Flemans@.apakgroup.com> wrote in message
> news:O5JaVwdAEHA.2480@.TK2MSFTNGP12.phx.gbl...
> problems
but
> do
>

Sunday, February 19, 2012

Date Conversion

I'm trying to extract some data to files to insert into an
oracle table and I'm having difficulty in getting the date
formatted so that oracle can read it. How do I get a date
out of SQL Server so that it will conform to dd-mon-yyyy
and Oracle won't cough and sputter?
Don't know what Oracle will accept but you can use CONVERT() to format the
date into any kind of string you wish. Specifically the 130 option sounds
like what your after. Check out CONVERT() in BooksOnLine.
Andrew J. Kelly SQL MVP
"Ptaz" <ptaz@.comcast.net> wrote in message
news:1df3801c454a4$9da12550$a501280a@.phx.gbl...
> I'm trying to extract some data to files to insert into an
> oracle table and I'm having difficulty in getting the date
> formatted so that oracle can read it. How do I get a date
> out of SQL Server so that it will conform to dd-mon-yyyy
> and Oracle won't cough and sputter?