find dates in string..

  • Thread starter Thread starter AccessARS
  • Start date Start date
A

AccessARS

I have a little chalenge as follows. In my access database I am pulling a
string in vba as follow:

"3/2/2008..3/19/2008"

I would like to place each of those dates in two a seperate shortdate
formated field as follows:

Start: 3/2/2008
End: 3/19/2008

I have attempted to use Left and Right but these dates will change on a
weekly basis in return changing the length based on the month and day.

thank you in advance for youtr assistance.
 
I have a little chalenge as follows. In my access database I am pulling a
string in vba as follow:

"3/2/2008..3/19/2008"

I would like to place each of those dates in two a seperate shortdate
formated field as follows:

Start: 3/2/2008
End: 3/19/2008

I have attempted to use Left and Right but these dates will change on a
weekly basis in return changing the length based on the month and day.

thank you in advance for youtr assistance.

Is the string exactly as formatted above, with .. separating the 2
parts?

=Cdate(Left("3/2/2008..3/19/2008",Instr("3/2/2008..3/19/2008","..")-1))
3/2/2008

=Cdate(Mid("3/2/2008..3/19/2008",Instr("3/2/2008..3/19/2008","..")+2))
3/19/2008

Replace "3/2/2008..3/19/2008" with the name of the variable string.
 
AccessARS said:
I have a little chalenge as follows. In my access database I am pulling a
string in vba as follow:

"3/2/2008..3/19/2008"

I would like to place each of those dates in two a seperate shortdate
formated field as follows:

Start: 3/2/2008
End: 3/19/2008

I have attempted to use Left and Right but these dates will change on a
weekly basis in return changing the length based on the month and day.

thank you in advance for youtr assistance.

Dim a As Variant
Dim dtFirst As Date, dtLast As Date

a = Split("3/2/2008..3/19/2008", "..")
dtFirst = a(0)
dtLast = a(1)
 
Back
Top