data types in sql server

       I have a query in sql server that returns the following
The table these data fields come from is a local temp table
The data itself comes from an OPENQUERY to an Oracle database

My question is,
I would like the date time to be presented as for example
Jan 14 2011 14.00
not as
Jan 14 2011 2:00PM

Is there some data type i can declare in the temp table that will produce this format?

Who is Participating?
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
I will answer with an article about date/time:

in short: your "output" is a presentation issue, not a data type issue per set.
the data is datetime. you want the output to be a certain format, so you need to format it to a string at some point.
you can do this in the database. in Oracle, it would be TO_CHAR, in SQL Server, it's CONVERT with the proper styles if available, otherwise it get's a bit "dirty" ...
Imran Javed ZiaConnect With a Mentor Consultant Software Engineer - .NET ArchitectCommented:
You can use following:
select convert(varchar, getdate(), 113)
select convert(varchar, getdate(), 13)
Please refer to following for more details
blossomparkAuthor Commented:
Hi angelIII and IJZ, that gives me plenty to work with...thanks for your responses...much appreciated :-)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.