This topic is locked

Text Field Needs to be Date Field

6/26/2009 5:26:25 PM
ASPRunnerPro General questions
author

I am using ASPRunnerPro 6.1 Build 1977.
I have a field, "nam_dob", that shows from the SQL DB that is text. It is actually a date of birth field that is formatted in the "yyyymmdd" format. When I bring it into ASPRunner, I need for it to look like a date (of some sort).
I have tried, in the field properties, to use the grayed out "Short Date", "Long Date", but it shows "No properties available" in the pane to the right. When I use either of these, it gives a error "Type mismatch: 'subMatches' " and does not display the webpage.
I have been toying with VB Left, Mid, and Right functions to try to parse it out and display something like "dd/mm/yyyy" but I have not been successful yet.
Is there any way that I can display that data in a dd/mm/yyyy format in the web page? At this point I am open to suggestions as to how to attack this item. Any assistance would be appreciated.

Thanks

Joe

J
Jane 6/30/2009

Hi,
use custom format for this field on the "View as" settings dialog on the Visual Editor tab.

You need to parse and format your values manually.

Here is a sample:

if strValue<>"" then

str = right(strValue,2) & "/" mid(strValue,3,2) & "/" & left(strValue,4)

strValue = str

end if

1312 7/15/2009

Hi,

use custom format for this field on the "View as" settings dialog on the Visual Editor tab.

You need to parse and format your values manually.

Here is a sample:



Jane thank you for you assistance, I made a few adjustments and it worked well. My solution to convert the SQL Db number string of YYYYMMDD to MM/DD/YYYY was this:
if strValue<>"" then

str = (mid(strValue,5,2)) & "/" & (right(strValue,2)) & "/" & (left(strValue,4))

strValue = str

end if
I would not have gotten this far is it wasn't for your direction,

Thank you again,

Joe