Hi

I am trying to achieve the following; display registered users birthdays in chronilogical month order where the date is greater than the current date - (only top 5) for this I have created the following SQL query in my recordset

SELECT TOP 5 firstName, surName, dob
FROM tblUsers
WHERE dob < now()

This is producing the required result
I now want to remove the year of birth for which I have created the following in a repeating table

<%= Right(bdayRS.Fields.Item("dob").Value, 4)%>

which trims the year off and works fine, however it displays as mm/dd (eg. 04/23)and I want it to display as monthname/dd (eg. April 23)

Please help - Thanks

Why dont you split your result into an array using the split method for example :

<%
Dim DOB, MyDobArray
DOB= bdayRS.Fields.Item("dob").Value
MyDobArray = Split(DOB,"/")  
%>

then you can format each area of the date because for example

MyDobArray(0) = "2009"
MyDobArray(1) = "04"
MyDobArray(2) = "23"

Another way could be to use the substring method just to get the month and then to call MonthName on the result

Hi

I am trying to achieve the following; display registered users birthdays in chronilogical month order where the date is greater than the current date - (only top 5) for this I have created the following SQL query in my recordset

SELECT TOP 5 firstName, surName, dob
FROM tblUsers
WHERE dob < now()

This is producing the required result
I now want to remove the year of birth for which I have created the following in a repeating table

<%= Right(bdayRS.Fields.Item("dob").Value, 4)%>

which trims the year off and works fine, however it displays as mm/dd (eg. 04/23)and I want it to display as monthname/dd (eg. April 23)

Please help - Thanks

How about this?
<%=(Month(bdayRS("dob")) & " " & Day(bdayRS("dob")))%>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.