Hi All,
I've been working on this for days and I can't find a solution. It's the last little detail that I have to complete before I can send this to the customer.
I have written a blog systme using ASP and have an Archive menu that displays an archive of posts by month and year.(ie Jun-2008)
I get this by doing the following:
1. When the user posts some content into the blog, a hidden field records <%Date()%> as a value. The field is set as a short date in the database.
2. There is another field that records the date but this time it records the 1st day of the month as such:
This field is used by the SQL to select the distinct records and allows me to sort the records in descending order.
The third field is used to display the actual month and year and is written from the date code into a string format as such
all of the data enters the fields in the database with out any errors.
The problem lies with the data in the last field. for some reason it sends the text"Jun-2008" into the field with 11 spaces before and 13 spaces after the text. and looks like:
I have tried to remove the spaces with the TRIM function as you can see above, but to no avail.
How can I achieve this effectively?
I have used three fields for a number of reasons
1. I can't use the date the post was written as a Distinct query as all the dates would appear.
2. I can't use the Archive date fiedl in date format because I use sessions to call the page that displays the relevant records for that particular month and it will not allow a search of "Jun-2008" as a date.
I have found that I need two fields, one with the first of the month for each post written in that month and one as a text field to sort the data by. It will work fine, except for all of those white spaces in the text field.
Any suggestion would be appreciated.
-------------------------------------------------------------
"The most overlooked advantage of owning a computer is that if they foul up there's no law against whacking them around a bit."
I've been working on this for days and I can't find a solution. It's the last little detail that I have to complete before I can send this to the customer.
I have written a blog systme using ASP and have an Archive menu that displays an archive of posts by month and year.(ie Jun-2008)
I get this by doing the following:
1. When the user posts some content into the blog, a hidden field records <%Date()%> as a value. The field is set as a short date in the database.
2. There is another field that records the date but this time it records the 1st day of the month as such:
Code:
<%
Dim Mymonth
Mymonth = Date()
Response.write "1-"&MonthName(Month(Mymonth),true)&"-"& Right(Year(Mymonth),2)
%>
The third field is used to display the actual month and year and is written from the date code into a string format as such
Code:
<%
Dim ArcDate
ArcDate = MonthName(Month(Mymonth),true)&"-"& Right(Year(Mymonth),4)
cstr(ArcDate)
Trim(ArcDate)
Response.Write(ArcDate)
%>
The problem lies with the data in the last field. for some reason it sends the text"Jun-2008" into the field with 11 spaces before and 13 spaces after the text. and looks like:
Code:
" June-2008
"
I have tried to remove the spaces with the TRIM function as you can see above, but to no avail.
How can I achieve this effectively?
I have used three fields for a number of reasons
1. I can't use the date the post was written as a Distinct query as all the dates would appear.
2. I can't use the Archive date fiedl in date format because I use sessions to call the page that displays the relevant records for that particular month and it will not allow a search of "Jun-2008" as a date.
I have found that I need two fields, one with the first of the month for each post written in that month and one as a text field to sort the data by. It will work fine, except for all of those white spaces in the text field.
Any suggestion would be appreciated.
-------------------------------------------------------------
"The most overlooked advantage of owning a computer is that if they foul up there's no law against whacking them around a bit."