>>>I've got the following date: 01/11/1999
>>>
>>>Is there a function that I can apply to it that will give me as a result: {^1999-11-01} ?
>>>
>>>The reason is that I wan to construct an SQL filter and I dont want to have 01/11/1999 in my construct but {^1999-11-01}.
>>
>>I am curious... why do you want to convert the date to a character in the filter, why not just leave it in a variable?
>
>Because my SELECT statement is going to be constructed from a date in a form. Maybe I should've said that the format of the date in the example that I gave was not static. The format of that date could be in the form DMY MDY or YMD.
>
>Anyway my problem is solved now.
>
>What I did is that I built my SELECT statement with the YEAR MONTH and DAY functions.
>
>'{^' + STR(YEAR(ldDate, 4) + '-' + STR(MONTH(ldDate)) + '-' + STR(DAY(ldDate)) + '}'
>
>
>Don't hesitate to reply if you think that you've go something better.
Always!
oRegExp = CREATEOBJ('Vbscript.RegExp')
oRegExp.pattern = '(\d{2})/(\d{2})/(\d{4})'
oRegExp.global = .t.
? oRegExp.Replace("01/11/1999 29/02/2000 Ed was born on 04/04/1957","{^$3-$2-$1}")