You can use a dictionary.
dateinnumeric = date
d=cdate(dateinnumeric)
msgbox d
dateArr = split(d,"/")
mon = dateArr(0)
dy = dateArr(1)
yr = dateArr(2)
msgbox "month = " & mon
' set up a dictionary
Set dict = createObject("Scripting.Dictionary")
dict.add 1,"one"
dict.add 2,"two"
dict.add 3,"three"
dict.add 4,"four"
dict.add 5,"five"
dict.add 6,"six"
dict.add 7,"seven"
dict.add 8,"eight"
dict.add 9,"nine"
dict.add 10,"ten"
' etc
alphayr = "twothousandthirteen"
function monthDay(num)
select case num
case 1
alpha = dict.item(1)
case 2
alpha = dict.item(2)
case 7
alpha = dict.item(7)
case 8
alpha = dict.item(8)
case 9
alpha = dict.item(9)
' and fill in the missing numbers up to 31
Case Else
alpha = "BAD Month or Day"
end select
monthDay = alpha
' msgbox "num = " & num & ", alpha = " & alpha
end function
alphaDate = monthday(dateArr(0)) & monthday(dateArr(1)) & alphayr
msgbox alphaDate
alphaDate = monthday(dateArr(0)) & "_"& monthday(dateArr(1)) & "_"& alphayr
msgbox alphaDate
If you want the date to be more readable, use an underscore or dash between
the month, day and year.
Is there a limit to the length of the string that can be entered?
hth,
Parke
On Mon, Jul 8, 2013 at 8:49 PM, <[email protected]> wrote:
> I am trying to put a system data and time in a field. The field doesn't
> take numbers. So when i put in the below code it rejects the entry. So i
> was wondering if we can use system date and time in Alpha as
> threeseventwothosandthirteen.
>
>
> On Sunday, July 7, 2013 3:20:22 PM UTC-4, [email protected] wrote:
>>
>> Hi I am trying to get system date & time in Alpha characters not in
>> Numeric no's. What should i do? Can i get in Alpha characters?
>> Replace(Date(), "/", "")& Replace(Replace(Time()," ", ""), ":", "")
>>
>> --
> --
> You received this message because you are subscribed to the Google
> "QTP - HP Quick Test Professional - Automated Software Testing"
> group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/MercuryQTP?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "QTP - HP Quick Test Professional - Automated Software Testing" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
Parke
Cell: 770-842-0121
--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
---
You received this message because you are subscribed to the Google Groups "QTP
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.