473,811 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Returning formated date

Hi
I have to return dates formated in different ways in an asp page from sql
server.
What function can I use or how can I return dates formated like so

I tried DATEPART ie.. but that does not work they way I would expect

"dd/mm/yy"
"dd/mm/ccyy"
"mm/dd/ccyy"
"mm/dd/yy"
"dd mmm ccyy"
"ccyymmdd"

Regards
Nancy
Jul 19 '05 #1
3 2219
Look at the
convert function in Bol
--
Roji. P. Thomas
SQL Server Programmer ;)
_______________ _________
"Don Grover" <sp******@assof t.com.au> wrote in message
news:O$******** ******@TK2MSFTN GP12.phx.gbl...
Hi
I have to return dates formated in different ways in an asp page from sql
server.
What function can I use or how can I return dates formated like so

I tried DATEPART ie.. but that does not work they way I would expect

"dd/mm/yy"
"dd/mm/ccyy"
"mm/dd/ccyy"
"mm/dd/yy"
"dd mmm ccyy"
"ccyymmdd"

Regards
Nancy

Jul 19 '05 #2
To add to Roji's response, consider formatting dates in your application
code. Formatting data for presentation is usually best handled in client
code.

--
Hope this helps.

Dan Guzman
SQL Server MVP
"Don Grover" <sp******@assof t.com.au> wrote in message
news:O$******** ******@TK2MSFTN GP12.phx.gbl...
Hi
I have to return dates formated in different ways in an asp page from sql
server.
What function can I use or how can I return dates formated like so

I tried DATEPART ie.. but that does not work they way I would expect

"dd/mm/yy"
"dd/mm/ccyy"
"mm/dd/ccyy"
"mm/dd/yy"
"dd mmm ccyy"
"ccyymmdd"

Regards
Nancy

Jul 19 '05 #3
Thanks all working now, had to format in code and add correct headers , now
work well.
Thanks Guys

"Dan Guzman" <da*******@nosp am-earthlink.net> wrote in message
news:OZ******** ******@tk2msftn gp13.phx.gbl...
To add to Roji's response, consider formatting dates in your application
code. Formatting data for presentation is usually best handled in client
code.

--
Hope this helps.

Dan Guzman
SQL Server MVP
"Don Grover" <sp******@assof t.com.au> wrote in message
news:O$******** ******@TK2MSFTN GP12.phx.gbl...
Hi
I have to return dates formated in different ways in an asp page from sql server.
What function can I use or how can I return dates formated like so

I tried DATEPART ie.. but that does not work they way I would expect

"dd/mm/yy"
"dd/mm/ccyy"
"mm/dd/ccyy"
"mm/dd/yy"
"dd mmm ccyy"
"ccyymmdd"

Regards
Nancy


Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3909
by: Funnyweb | last post by:
I have just notices that the date() function is not returning the correct date/time on my "server". I am running apache2 on my winxp pro laptop. My system clock is set to the correct date, time and timezone, get the results returned by date() are 11 hours behind. Any ideas what is going wrong?
0
2065
by: Nick Thurn | last post by:
Folks, I'm trying to define a oracle Java Stored Proc interface to an existing timeseries database. Series are accessed by name and are returned as vectors of type pairs, specifically (Date, number) (Date, date), (date, string), (number, number), (number, date) or (number,string). I could simply create all the types and their table types
4
2840
by: Earl T | last post by:
When I try to get the netscape version for version 7, I get the HttpBrowserCapabilities class returning the version as 5 and not 7. (see code and output below) CODE HttpBrowserCapabilities bc; string s; bc = Request.Browser; ....
3
5379
by: sb Luis | last post by:
I Use the following code to read from MS Word, but I couldent read Formated Text (RTF). How Can I read formated text from MS Word Doc without using clipboard. thanks. Word.ApplicationClass WordApp = new Word.ApplicationClass(); ..... // Let's get the content from the document Word.Paragraphs DocPar = Doc.Paragraphs; // Count number of paragraphs in the file
2
28061
by: Pat Brown | last post by:
I am pulling an integer value of the amount of seconds since 12:00 am from a SQL Server DB. I want to convert this integer into a formated string or datetime to display a legible time of day. Are there any built in methods in the .NET framework that will accomplish this. If not, any other suggestion about creating a method to do this would be appretiated. Thanks
6
7658
by: SQL Server | last post by:
I've been working this for a while. Kind of new to SQL Server functions and not seeing what I am doing wrong. I have this function CREATE FUNCTION dbo.test (@Group varchar(50)) RETURNS smalldatetime AS BEGIN Declare @retVal varchar(10) (SELECT @retVal= MIN() FROM dbo.t_master_schedules WHERE (event_id = 13) AND (group_ =@Group)) return convert(smalldatetime, @retVal, 1)
11
21080
by: walterbyrd | last post by:
My MySQL table has a field that is set as type "date." I need to get today's date, and insert it into that field. The default for that MySQL field is 2006-00-00. I know about the date() function. I have tried date("Y-m-d") and date("U"), neither worked. The date field was just filed with all zeros. Can anybody point me in the right direction?
0
2195
by: iheartvba | last post by:
Hi, I have got a document where there are headings which are always the same, but their sub categories are always different. The Structure is as follows: Line 1: Heading 1 Line 2: Sub Heading 1-1 Line 3: Sub Heading 1-2 Line 4: Heading 2 Line 5: Sub Heading 2-1 Line 6: Sub Heading 2-2 Line 7: Sub Heading 2-3
3
1601
by: zandiT | last post by:
Hello I have an access report and im using a query to filter the report using Date parameters eg Start Date-12 May 2009 and End Date-30 September 2009. the query works perfectly. My problem is recently i formated the date values so they appear as May 2009 instead of 12 May 2009. When i tried to use the filtering query again it did not work. Instead the result set from the query only showed records from the two dates in the parameter, ...
0
9728
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10389
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10402
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10135
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4339
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3867
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3018
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.