If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > ASP DateTime Format Problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-24-05, 10:54
donaldt donaldt is offline
Registered User
 
Join Date: Jan 2002
Location: Nottingham - UK
Posts: 113
ASP DateTime Format Problem

Hello folks

Im using SQL 2000 & ASP

I need to display the date from my SQL DateTime field in the following format;

'August 2005'

The closest I can get to this is;

'24 August 2005'

Can anyone help or point me in the right direction please ?

Many thanks

Donald
Reply With Quote
  #2 (permalink)  
Old 10-24-05, 22:12
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
There are a few ways.... the most obvious to me would be something like
Code:
datDate = CDate(recordsetName("FieldName"))
strDate = MonthName(Month(datDate)) & ' ' & Year(datDate)
not sure if this will give you August 2005 or August 05 though...

Check on the Month, Year, MonthName functions and you should be able to solve this problem easily.

Last edited by rokslide; 10-24-05 at 22:16. Reason: missed the closing code tag
Reply With Quote
  #3 (permalink)  
Old 10-24-05, 22:13
priyanka-m6.net priyanka-m6.net is offline
Registered User
 
Join Date: Jul 2004
Posts: 94
Hi,
For that you might need to use the MonthName() and Year().
__________________
Priyanka
Windows web hosting with ASP,.Net,PHP,Perl,MySQL support
We help in making your dreams come true on internet!
Reply With Quote
  #4 (permalink)  
Old 10-26-05, 12:32
chuck59 chuck59 is offline
Registered User
 
Join Date: Oct 2005
Location: Karachi
Posts: 6
MonthName(datDate) will print full month name. i.e. August
MonthName(datDate, True) will print month name in abbreviated form. i.e. Aug
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On