Formating Text in DB.R.W. columns

B

bfiser

I have a Database Results Wizard search form. One of the results it
displays is date of birth. Can I format that column or field so that
it is dispalyed in this format
YYYY/MM/DD

Specifically I need to add the slash (/) it currently displays like
this YYYYMMDD w/ no slashes.


Below is a comment from the requestor in case this helps in
understanding what needs to be done.
" I think the dob field is a char field in this database.
Can it be displayed as CCYY/MM/DD ie '/'s used? "


Thanks,
 
S

Stefan B Rusynko

Ideally you should change the DB field to a date field w/ proper dates
- as a text field you have no control over bad dates
The only way to convert your text date to what you want is w/ ASP parsing code
In your DBR cell, you could try to do this by changing your text date field
- say it is named now as fp_rs("dob"):

Change
<%= fp_rs("dob") %>
To
<%= left(fp_rs("dob"),4) & "/" & mid(fp_rs("dob"),5,2) & "/" &right (fp_rs("dob"),2) %>

Above will fail if any of your text dates have less than 8 characters

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________



|I have a Database Results Wizard search form. One of the results it
| displays is date of birth. Can I format that column or field so that
| it is dispalyed in this format
| YYYY/MM/DD
|
| Specifically I need to add the slash (/) it currently displays like
| this YYYYMMDD w/ no slashes.
|
|
| Below is a comment from the requestor in case this helps in
| understanding what needs to be done.
| " I think the dob field is a char field in this database.
| Can it be displayed as CCYY/MM/DD ie '/'s used? "
|
|
| Thanks,
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top