Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 14th, 2005, 11:18 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default datetime function

Hi there

Is it possible to pull out part of the string from a datetime column in SQL - i.e if I just wanted to pull out the month, how would I do it?

thanks

Adam

 
Old July 14th, 2005, 11:38 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Default

Month(MyDate)

 
Old July 14th, 2005, 11:53 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default

Great, thanks - 1 more thing on this topic.

I've built some asp pages to enter the date in; if I want to put at the top of dates in July - 'July' and the same for August etc, (just to differentiate the months) how would I go about it?

thanks

Adam

 
Old July 15th, 2005, 03:00 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default

Further to this, how do you write the day and the year i.e like pullling out the month as so:

<%=MonthName(Month( strDateString ))%>

what would be the same but for the year and the day?

thanks

Adam

 
Old July 19th, 2005, 04:49 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

For Year it is Year(strDateString)
and for Day it is Day(strDateString)

Hope that helps.
Cheers

_________________________
- Vijay G
Strive for Perfection
 
Old July 23rd, 2005, 02:24 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default

thanks VJ






Similar Threads
Thread Thread Starter Forum Replies Last Post
function adjust-dateTime-to-timezone Tomi XSLT 3 July 26th, 2006 11:51 AM
DateTime RickP SQL Server 2000 7 December 14th, 2005 07:08 PM
UTC DateTime to Local DateTime r_ganesh76 SQL Server 2000 1 April 4th, 2005 08:21 AM
DateTime DARSIN General .NET 1 December 1st, 2004 06:24 AM
[ReportingService] DateTime function errors WindyZhu SQL Server 2000 2 June 17th, 2004 01:36 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.