![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a ton of strings I am parsing out and the only problem I have is knowing whats a date and whats a special chr in a text field. ##/##/## is a date and so is #/#/## while bob/fred/mary is not. so I checked and its ok for me to just replace all the non date / with an underscore. This way I can populate a table with the date and comment I pull out of each memo field. replace sounds nice but how do I check and see if the chr in front of or behind the / is a number or a " " or a chr? is this the best way to go? |
#3
| |||
| |||
|
|
I have a ton of strings I am parsing out and the only problem I have is knowing whats a date and whats a special chr in a text field. ##/##/## is a date and so is #/#/## while bob/fred/mary is not. so I checked and its ok for me to just replace all the non date / with an underscore. This way I can populate a table with the date and comment I pull out of each memo field. replace sounds nice but how do I check and see if the chr in front of or behind the / is a number or a " " or a chr? is this the best way to go? __________ Information from ESET Smart Security, version of virus signature database 3999 (20090410) __________ The message was checked by ESET Smart Security. http://www.eset.com |
#4
| |||
| |||
|
|
Salad's way is simpler and easier, but if you want to test character by character, the ASCII code of a numeric character is greater than 48 and less than 58 and the most commonly used blank/space character's ASCII code is 32. |
|
Larry Linson Microsoft Office Access MVP "sparks" <sparks (AT) comcast (DOT) net> wrote in message news:lq2vt4pd3agfvujv85sijosvtc97q7ko7v (AT) 4ax (DOT) com... I have a ton of strings I am parsing out and the only problem I have is knowing whats a date and whats a special chr in a text field. ##/##/## is a date and so is #/#/## while bob/fred/mary is not. so I checked and its ok for me to just replace all the non date / with an underscore. This way I can populate a table with the date and comment I pull out of each memo field. replace sounds nice but how do I check and see if the chr in front of or behind the / is a number or a " " or a chr? is this the best way to go? __________ Information from ESET Smart Security, version of virus signature database 3999 (20090410) __________ The message was checked by ESET Smart Security. http://www.eset.com __________ Information from ESET Smart Security, version of virus signature database 3999 (20090410) __________ The message was checked by ESET Smart Security. http://www.eset.com |
#5
| |||
| |||
|
|
Larry Linson wrote: Salad's way is simpler and easier, but if you want to test character by character, the ASCII code of a numeric character is greater than 48 and less than 58 and the most commonly used blank/space character's ASCII code is 32. I see that if I did ? IsDate("12/ 1/08) it returns True If the OP is returning a value to a Date field then ? IIF(isDate("12/ 1/08"),CDate("12/ 1/08"),null) would work as it converts to a date or a null. If the field was a string, then maybe ? IIF(isDate("12/ 1/08"),Cstr(CDate("12/ 1/08")),null) would work as it removes the space by converting to a date then to a string. Larry Linson Microsoft Office Access MVP "sparks" <sparks (AT) comcast (DOT) net> wrote in message news:lq2vt4pd3agfvujv85sijosvtc97q7ko7v (AT) 4ax (DOT) com... I have a ton of strings I am parsing out and the only problem I have is knowing whats a date and whats a special chr in a text field. ##/##/## is a date and so is #/#/## while bob/fred/mary is not. so I checked and its ok for me to just replace all the non date / with an underscore. This way I can populate a table with the date and comment I pull out of each memo field. replace sounds nice but how do I check and see if the chr in front of or behind the / is a number or a " " or a chr? is this the best way to go? __________ Information from ESET Smart Security, version of virus signature database 3999 (20090410) __________ The message was checked by ESET Smart Security. http://www.eset.com __________ Information from ESET Smart Security, version of virus signature database 3999 (20090410) __________ The message was checked by ESET Smart Security. http://www.eset.com |
![]() |
| Thread Tools | |
| Display Modes | |
| |