Hello Vegas,
String and Text are the same thing really. Text fields hold strings. I apologize if I confused you.
For the ones bound to date, you simple need to change the display format in Sesame Designer.
For the ones that are bound to text, if all that is ever stored in that element is a date then I would recommend changing the field type to Date. If the date is mixed in with other data, You'll need a Mass Update like the following:
Var vData as String
Var vDatePositions as String
Var vLoop as Int
Var vCnt as Int
Var vDate as Array[3] of String
Var vWhich as Int
Var vStart as Int
Var vPos as Int
Var vLength as Int
Var vOffset as Int
Var vOldDateSep as Char
Var vNewDateSep as Char
//Pull element value into a string for easy manipulation
vData = ElementName
vOldDateSep = "-"
vNewDateSep = "/"
//Search for dates that have 1 or 2 digits then a dash then 1 or 2 digits then a dash and then 2 or 4 digits
vDatePositions = @RegexFindString(vData, "\d{1,2}" + vOldDateSep + "\d{1,2}" + vOldDateSep + "\d{2,4}", 1)
If vDatePositions <> "" Then
{
vLoop = 1
vOffset = 0
vCnt = @CountStringArray(vDatePositions)
While vLoop <= vCnt
{
//Loop through each date found in the data
vWhich = 1
vDate[1] = ""
vDate[2] = ""
vDate[3] = ""
//Get the start position and the length of the Date found.
vStart = @TN(@AccessStringArray(vDatePositions, vLoop)) + vOffset
vLength = @AccessStringArray(vDatePositions, vLoop + 1)
vPos = vStart
While vPos < (vStart + vLength)
{
//Loop through the Date found character by character and place it into the array depending on how many dashes we have encountered.
If @Mid(vData, vPos, 1) = vOldDateSep Then
{
vWhich = vWhich + 1
}
Else
{
vDate[vWhich] = vDate[vWhich] + @Mid(vData, vPos, 1)
}
vPos = vPos + 1
}
//If it's a 2 digit year
If @Len(vDate[3]) = 2 Then
{
vOffset = vOffset + 2
//The next bit of code guesses that if the year is a two digit year that is greater than 15 that you mean 1900's
If @TN(vDate[3]) > 15 Then
{
vDate[3] = "19" + vDate[3]
}
Else
{
vDate[3] = "20" + vDate[3]
}
}
vData = @Left(vData, vStart-1) + vDate[1] + vNewDateSep + vDate[2] + vNewDateSep + vDate[3] + @Right(vData, @Len(vData)-(vStart + vLength)+1)
//Advance by 2 to skip to the next occurence of a date
vLoop = vLoop + 2
}
}
//Set value back to the element
ElementName = vData
I highly recommend making a backup before attempting this or any Mass Update. You'll need to replace ElementName with the name of the element you want to process.
-Ray